【问题标题】:expo-auth-session, how to get redirected to the app, when not using a local redirectUriexpo-auth-session,如何在不使用本地 redirectUri 时重定向到应用程序
【发布时间】: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


    【解决方案1】:

    我很确定您误读了文档。回复 URL 是您添加应用程序页面的位置,用户在登录后被重定向到该页面。 您使用的 URL 是文档中的示例 URL。

    请查看official documentation

    【讨论】:

      猜你喜欢
      • 2022-07-17
      • 1970-01-01
      • 2021-02-10
      • 2022-10-13
      • 2022-01-22
      • 1970-01-01
      • 2015-05-07
      • 2021-07-02
      • 1970-01-01
      相关资源
      最近更新 更多