use of bio.terra.externalcreds.models.OAuth2State in project terra-external-credentials-manager by DataBiosphere.
the class ProviderService method validateOAuth2State.
private void validateOAuth2State(String providerName, String userId, String encodedState) {
try {
OAuth2State oAuth2State = OAuth2State.decode(objectMapper, encodedState);
if (!providerName.equals(oAuth2State.getProvider())) {
throw new InvalidOAuth2State();
}
linkedAccountService.validateAndDeleteOAuth2State(userId, oAuth2State);
} catch (CannotDecodeOAuth2State e) {
throw new InvalidOAuth2State(e);
}
}
Aggregations