Search in sources :

Example 1 with LoginService

use of org.edx.mobile.authentication.LoginService in project edx-app-android by edx.

the class OauthRefreshTokenAuthenticator method refreshAccessToken.

@NonNull
private AuthResponse refreshAccessToken(AuthResponse currentAuth) throws IOException, HttpStatusException {
    // RoboGuice doesn't seem to allow this to be injected via annotation at initialization
    // time. TODO: Investigate whether this is a bug in RoboGuice.
    LoginService loginService = RoboGuice.getInjector(context).getInstance(RetrofitProvider.class).getNonOAuthBased().create(LoginService.class);
    AuthResponse refreshTokenData = executeStrict(loginService.refreshAccessToken("refresh_token", config.getOAuthClientId(), currentAuth.refresh_token));
    loginPrefs.storeRefreshTokenResponse(refreshTokenData);
    return refreshTokenData;
}
Also used : LoginService(org.edx.mobile.authentication.LoginService) AuthResponse(org.edx.mobile.authentication.AuthResponse) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)1 AuthResponse (org.edx.mobile.authentication.AuthResponse)1 LoginService (org.edx.mobile.authentication.LoginService)1