react-simple-oauth2-login icon indicating copy to clipboard operation
react-simple-oauth2-login copied to clipboard

How to specify scopes

Open nerdy-plutonian-ng opened this issue 3 years ago • 1 comments

How do I include scopes in my configuration please.

nerdy-plutonian-ng avatar Jun 09 '21 10:06 nerdy-plutonian-ng

Hello! Thanks for your question and sorry for the delayed answer. It's indicated under the Props section of the documentation: scope

Basically you have to give this scope prop the string containing relevant scope(s), separated by spaces. Example for Spotify (derived from the doc's example):

<OAuth2Login
    scope="user-top-read user-follow-read"
    authorizationUrl="https://accounts.spotify.com/authorize"
    responseType="token"
    clientId="9822046hvr4lnhi7g07grihpefahy5jb"
    redirectUri="http://localhost:3000/oauth-callback"
    onSuccess={onSuccess}
    onFailure={onFailure} />

Please let me know if this helped!

bhubr avatar Jun 16 '21 20:06 bhubr