uber sdk中的JWT错误无效

时间:2017-01-25 10:01:04

标签: android uber-api

我正在使用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。

0 个答案:

没有答案