【发布时间】:2021-02-02 09:12:38
【问题描述】:
我正在尝试在我的应用程序中创建身份验证功能,因此当我按下登录按钮时,会打开一个网络浏览器并验证我的帐户,然后我会在 URL 中获得一个令牌,问题是为了让我被重定向到我的应用程序,我需要将 redirect_uri 设置为 AuthSession.makeRedirectUri( 'gecond://' )
但我从中获取身份验证的网站不允许这种类型的 redirect_uri(这是正在使用的 URI:“https://preprod.autenticacao.gov.pt/oauth/askauthorization?redirect_uri= exp%3A%2F%2F192.168.2.26%3A19000&client_id=123456789&response_type=token&state=UOgf2pE6S0"), 它只允许特定的redirect_uri(如“https://preprod.autenticacao.gov.pt/oauth/askauthorization?redirect_uri='https://preprod.autenticacao.gov.pt/OAuth/Authorized'&client_id=123456789&response_type=token&state =UOgf2pE6S0"),但是当我使用此 URI 时,我确实设法在页面的 URL 中获取了访问令牌,但我没有被重定向回我的应用程序。 我对这类主题还很陌生,所以我可能会遗漏一些步骤。
【问题讨论】:
标签: react-native authentication oauth-2.0 expo react-native-android