Skip to content

Conversation

mribbons
Copy link
Contributor

I had an issue with http://github.com/identityServer/IdentityServer3 where it expects a space separated list of scopes, while react-native-oauth supports a comma separated list.

In the previous code, spaces are removed before the string is split by comma.

To use the option:

 manager.addProvider({ 'our_provider': { auth_version: '2.0', authorize_url: 'http://example.com/authorize', access_token_url: 'http://example.com/token', access_token_verb: 'post', api_url: 'http://example.com/api', callback_url: ({app_name}) => `${app_name}://oauth` } }); manager.configure({ our_provider: { client_id: 'sample', client_secret: 'secret', consumer_key: 'must_be_provided_for_custom_provider', api_key: 'must_be_provided_for_custom_provider', consumer_secret: 'must_be_provided_for_custom_provider', rawScopes: 'true' } }); manager.authorize('our_provider', {scopes: 'openid profile api1'}); 

This resolves the issue.

Note that I have not tested with ios.

Note that this PR is similar to a0dd695, except that it is a non breaking change.

Implement rawScopes configuration option - Handle auth servers that expect space separated list of scopes. Without the option enabled spaces are removed from scope string.
@auser auser merged commit 2a1fb1b into fullstackreact:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants