I am facing a problem getting user information with companion app.
AuthorizationManager.authorize(new AuthorizeRequest.Builder(requestContext) .addScopes(ScopeFactory.scopeNamed("alexa:all", scopeData), ProfileScope.profile()) .forGrantType(AuthorizeRequest.GrantType.AUTHORIZATION_CODE) .withProofKeyParameters(codeVerifier, CODE_CHALLENGE_METHOD) .build());
When I call the api above, the response is normally received, but there is no user information there, so I call the User.fetch api again. However, I am also unable to obtain user information with the fail log below.
AuthError cat= BAD_REQUEST type=ERROR_BAD_API_PARAM - com.amazon.identity.auth.device.InsufficientScopeAuthError: Profile request not valid for authorized scopes
AuthorizationManager.authorize( new AuthorizeRequest.Builder(requestContext) .addScope(ProfileScope.profile()) .build());
After calling the above code, user information can be normally obtained and there is no need to call the User.fetch api as well.
Do I have to call the authorize api twice to get a user information? or any solutions there?
Thanks in advance for your help.