Search in sources :

Example 1 with TokenInfo

use of com.zype.android.webapi.model.auth.TokenInfo in project zype-android by zype.

the class LoginActivity method handleAccessTokenInfo.

@Subscribe
public void handleAccessTokenInfo(AccessTokenInfoEvent event) {
    Logger.d("handleAccessTokenInfo");
    showProgress(false);
    TokenInfo data = event.getEventData().getModelData();
    SettingsProvider.getInstance().saveAccessTokenApplication(data.getApplicationData());
    SettingsProvider.getInstance().saveAccessTokenCreatedAt(data.getCreatedAt());
    SettingsProvider.getInstance().saveAccessTokenExpiration(data.getExpiresInSeconds());
    SettingsProvider.getInstance().saveAccessTokenResourceOwnerId(data.getResourceOwnerId());
    SettingsProvider.getInstance().saveAccessTokenScopes(data.getScopes());
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken();
    getApi().executeRequest(WebApiManager.Request.CONSUMER_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder) TokenInfo(com.zype.android.webapi.model.auth.TokenInfo) Subscribe(com.squareup.otto.Subscribe)

Example 2 with TokenInfo

use of com.zype.android.webapi.model.auth.TokenInfo in project zype-android by zype.

the class LoginActivity method handleAccessTokenInfo.

@Subscribe
public void handleAccessTokenInfo(AccessTokenInfoEvent event) {
    Logger.d("handleAccessTokenInfo");
    showProgress(false);
    TokenInfo data = event.getEventData().getModelData();
    SettingsProvider.getInstance().saveAccessTokenApplication(data.getApplicationData());
    SettingsProvider.getInstance().saveAccessTokenCreatedAt(data.getCreatedAt());
    SettingsProvider.getInstance().saveAccessTokenExpiration(data.getExpiresInSeconds());
    SettingsProvider.getInstance().saveAccessTokenResourceOwnerId(data.getResourceOwnerId());
    SettingsProvider.getInstance().saveAccessTokenScopes(data.getScopes());
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken();
    getApi().executeRequest(WebApiManager.Request.CONSUMER_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder) TokenInfo(com.zype.android.webapi.model.auth.TokenInfo) Subscribe(com.squareup.otto.Subscribe)

Aggregations

Subscribe (com.squareup.otto.Subscribe)2 ConsumerParamsBuilder (com.zype.android.webapi.builder.ConsumerParamsBuilder)2 TokenInfo (com.zype.android.webapi.model.auth.TokenInfo)2