Search in sources :

Example 6 with MSAAuthenticationProvider

use of com.microsoft.appcenter.sasquatch.MSAAuthenticationProvider in project appcenter-sdk-android by microsoft.

the class MSALoginActivity method registerAppCenterAuthentication.

private void registerAppCenterAuthentication(String userId) {
    sSharedPreferences.edit().putString(MSA_REFRESH_TOKEN_SCOPE_KEY, mRefreshTokenScope).apply();
    sSharedPreferences.edit().putString(MSA_REFRESH_TOKEN_KEY, mRefreshToken).apply();
    sSharedPreferences.edit().putInt(MSA_AUTH_TYPE_KEY, mAuthType.ordinal()).apply();
    sSharedPreferences.edit().putString(MSA_TOKEN_KEY, userId).apply();
    MSAAuthenticationProvider tokenProvider = MSAAuthenticationProvider.getInstance(mRefreshToken, mRefreshTokenScope, this);
    AuthenticationProvider provider = new AuthenticationProvider(mAuthType, userId, tokenProvider);
    AnalyticsTransmissionTarget.addAuthenticationProvider(provider);
    finish();
    Toast.makeText(this, R.string.signed_in, Toast.LENGTH_SHORT).show();
}
Also used : MSAAuthenticationProvider(com.microsoft.appcenter.sasquatch.MSAAuthenticationProvider) AuthenticationProvider(com.microsoft.appcenter.analytics.AuthenticationProvider) MSAAuthenticationProvider(com.microsoft.appcenter.sasquatch.MSAAuthenticationProvider)

Aggregations

AuthenticationProvider (com.microsoft.appcenter.analytics.AuthenticationProvider)6 MSAAuthenticationProvider (com.microsoft.appcenter.sasquatch.MSAAuthenticationProvider)6 SuppressLint (android.annotation.SuppressLint)3 StrictMode (android.os.StrictMode)3 ListView (android.widget.ListView)3 TextView (android.widget.TextView)3 ErrorReport (com.microsoft.appcenter.crashes.model.ErrorReport)3 TestFeaturesListAdapter (com.microsoft.appcenter.sasquatch.features.TestFeaturesListAdapter)3 SasquatchDistributeListener (com.microsoft.appcenter.sasquatch.listeners.SasquatchDistributeListener)3 UUID (java.util.UUID)3