use of com.microsoft.identity.common.internal.authscheme.INameable 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