use of com.microsoft.identity.common.internal.authscheme.PopAuthenticationSchemeInternal in project microsoft-authentication-library-common-for-android by AzureAD.
the class MsalBrokerRequestAdapter method getAuthenticationScheme.
@NonNull
private static AbstractAuthenticationScheme getAuthenticationScheme(@NonNull final Context context, @NonNull final BrokerRequest request) {
final AbstractAuthenticationScheme requestScheme = request.getAuthenticationScheme();
if (null == requestScheme) {
// Default assumes the scheme is Bearer
return new BearerAuthenticationSchemeInternal();
} else {
if (requestScheme instanceof PopAuthenticationSchemeInternal) {
final IClockSkewManager clockSkewManager = new ClockSkewManager(context);
((PopAuthenticationSchemeInternal) requestScheme).setClockSkewManager(clockSkewManager);
}
return requestScheme;
}
}
use of com.microsoft.identity.common.internal.authscheme.PopAuthenticationSchemeInternal in project microsoft-authentication-library-common-for-android by AzureAD.
the class MsalBrokerRequestAdapter method getRequestBundleForGenerateShr.
/**
* Method to construct a request {@link Bundle} for broker generateShr.
*
* @param parameters Input request params.
* @param negotiatedBrokerProtocolVersion The negotiated broker protocol version in use.
* @return The result Bundle from the Broker.
*/
public Bundle getRequestBundleForGenerateShr(@NonNull final GenerateShrCommandParameters parameters, @NonNull final String negotiatedBrokerProtocolVersion) {
final String clientId = parameters.getClientId();
final String homeAccountId = parameters.getHomeAccountId();
// Convert the supplied public class to the internal representation
final PopAuthenticationSchemeInternal popParameters = (PopAuthenticationSchemeInternal) AuthenticationSchemeFactory.createScheme(parameters.getAndroidApplicationContext(), (INameable) parameters.getPopParameters());
final String popParamsJson = sRequestAdapterGsonInstance.toJson(popParameters, PopAuthenticationSchemeInternal.class);
final Bundle requestBundle = new Bundle();
requestBundle.putString(ACCOUNT_CLIENTID_KEY, clientId);
requestBundle.putString(ACCOUNT_HOME_ACCOUNT_ID, homeAccountId);
requestBundle.putString(AUTH_SCHEME_PARAMS_POP, popParamsJson);
requestBundle.putString(NEGOTIATED_BP_VERSION_KEY, negotiatedBrokerProtocolVersion);
return requestBundle;
}
Aggregations