React native OAuth2 redirect_uri: Invalid scheme

后端 未结 2 1590
春和景丽
春和景丽 2021-01-25 09:55

recently I\'ve been learning about react native and I encountered a so farm unsolvable problem. I\'m trying to authenticate using gmail OAuth2 from my app, as a redirect paramet

2条回答
  •  梦谈多话
    2021-01-25 10:24

    I'm using AppAuth library to get the OAuth2 tokens. As per the Google's official document, this format has worked for me.

    :/oauth2callback

    For example, if your app id is com.example.app, then in your AndroidManifest.xml

    
            
                
                
                
                
            
    
    

    And the redirectUrl to be provided to AppAuth would look like this

    private val redirectUrl = "com.example.app:/oauth2callback"
    

    Hope this helps someone.

提交回复
热议问题