okta / samples-android

samples-android
https://github.com/okta/samples-android
Apache License 2.0
37 stars 52 forks source link

Refresh token "errorDescription":"individual scopes cannot be null or empty" #69

Closed yahmi closed 3 years ago

yahmi commented 3 years ago

hello , I have set the configuration for my project on the sample , I get the access token but when I try to get the refreshToken , I receive the error message "errorDescription":"individual scopes cannot be null or empty"

@JayNewstrom @NikitaAvraimov-okta

JayNewstrom commented 3 years ago

Hi @yahmi could you paste the scopes you have configured here?

yahmi commented 3 years ago

hi @JayNewstrom "scopes": [ "openid", "profile", "offline_access", "idb2c" ],

JayNewstrom commented 3 years ago

I'm not able to reproduce this issue. Could you show how you're instantiating your OIDCConfig?

Here's how I'm doing it with the scopes you provided.

OIDCConfig mOidcConfig = new OIDCConfig.Builder()
        .withJsonFile(context, R.raw.okta_oidc_config)
        .create();
yahmi commented 3 years ago

Hello @JayNewstrom I do the same , but backend need to send scopes because the method throw null , so the issue is closed for my side

JayNewstrom commented 3 years ago

Ok, thanks for the update. If you have any other questions, feel free to open a new issue.

yahmi commented 3 years ago

@JayNewstrom params.put("scope", AsciiStringListUtil.iterableToString(Collections.singletonList(scope)) the error is throwen here when the backend don't send scopes maybe need a fix for fetaure version

JayNewstrom commented 3 years ago

If the server is sending scopes, please make sure the server is sending the correct scopes. If the server is unable to send the correct scopes, you'll need to add logic to the app to filter null/empty scopes before sending them to the SDK, or provide a default set of scopes if the server is unable to send the scopes.