public class AuthorizationContext extends Object
| Constructor and Description |
|---|
AuthorizationContext(AuthorizationHeader ah) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertValidForPartner(String partnerId)
Convenience method to check the given partnerId against the partner identified in the
authorization header, and throw an authorization exception if they don't
match. |
AuthorizationHeader |
getAuthorizationHeader()
The original
AuthorizationHeader instance supplied with the request. |
public AuthorizationContext(AuthorizationHeader ah)
public AuthorizationHeader getAuthorizationHeader()
AuthorizationHeader instance supplied with the request.public void assertValidForPartner(String partnerId) throws AuthorizationFailedException
authorization header, and throw an authorization exception if they don't
match. This is needed in cases where the partner ID appears in the application-level request, and you want to
make sure one valid partner is not posing as another.partnerId - The partner ID called out in the request bodyAuthorizationFailedException - if the auth header refers to an unexpected partnerCopyright © 2020. All rights reserved.