use of com.microsoft.identity.common.internal.authscheme.IPoPAuthenticationSchemeParams in project microsoft-authentication-library-common-for-android by AzureAD.
the class LocalMSALController method generateSignedHttpRequest.
@Override
public GenerateShrResult generateSignedHttpRequest(@NonNull final GenerateShrCommandParameters parameters) throws Exception {
final Context context = parameters.getAndroidApplicationContext();
final IClockSkewManager clockSkewManager = new ClockSkewManager(context);
final OAuth2TokenCache cache = parameters.getOAuth2TokenCache();
final String clientId = parameters.getClientId();
final String homeAccountId = parameters.getHomeAccountId();
final IPoPAuthenticationSchemeParams popSchemeParams = parameters.getPopParameters();
final GenerateShrResult result;
if (userHasLocalAccountRecord(cache, clientId, homeAccountId)) {
// Perform the signing locally...
result = DevicePoPUtils.generateSignedHttpRequest(context, clockSkewManager, popSchemeParams);
} else {
// Populate the error on the result and return...
result = new GenerateShrResult();
result.setErrorCode(GenerateShrResult.Errors.NO_ACCOUNT_FOUND);
result.setErrorMessage("Account does not exist.");
}
return result;
}
Aggregations