else if(
! authorizationTokenString
.equals(currElementParts[1])) {
throw
new InvalidAuthorizationException(
"Multiple, different third-party " +
"credentials were provided as '" +
HEADER_AUTHORIZATION_BEARER +
"' " +
HEADER_AUTHORIZATION +
" headers.");
}
}
}
// If the authorization token was given, attempt to add the
// third-party to the request.
if(authorizationTokenString != null) {
// Attempt to get the authorization token.
AuthorizationToken authorizationToken =
AuthorizationTokenBin
.getInstance()
.getTokenFromAccessToken(authorizationTokenString);
// If the token is null, it does not exist or is expired.
if(authorizationToken == null) {
throw
new InvalidAuthorizationException(
"The authorization token is unknown or " +
"expired.");
}
// Add the token to the request as an attribute.