我正在使用SSO通过我的应用程序将用户登录到uber。这是我的代码:
SessionConfiguration config = new SessionConfiguration.Builder()
// mandatory
.setClientId(AppConstants.UBER_CLIENT_ID)
// required for enhanced button features
.setServerToken(AppConstants.UBER_SERVER_TOKEN)
// required scope for Ride Request Widget features
.setScopes(Arrays.asList(Scope.PROFILE))
// optional: set Sandbox as operating environment
.setEnvironment(SessionConfiguration.Environment.SANDBOX)
.build();
UberSdk.initialize(config);
LoginCallback loginCallback = new LoginCallback() {
@Override
public void onLoginCancel() {
// User canceled login
Log.i(TAG, "login cancelled");
}
@Override
public void onLoginError(@NonNull AuthenticationError error) {
// Error occurred during login
Log.i(TAG, error.toString());
Log.i(TAG, "login failed");
}
@Override
public void onLoginSuccess(@NonNull AccessToken accessToken) {
// Successful login! The AccessToken will have already been saved.
Log.i(TAG, "login successful");
}
@Override
public void onAuthorizationCodeReceived(@NonNull String authorizationCode) {
Log.i(TAG, authorizationCode);
}
};
accessTokenManager = new AccessTokenManager(this);
loginManager = new LoginManager(accessTokenManager, loginCallback);
loginManager.login(this);
我收到了Invalid_JWT。这是什么问题。我也在我的超级仪表板中设置了PROFILE Scope。