public class InsufficientScopeChallengeHandler extends AuthenticateChallengeHandler
Response
when the request is missing some required scope.
Example:
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer realm="example",
error="insufficient_scope",
error_description="....",
scope="openid profile email"
WWW_AUTHENTICATE
Constructor and Description |
---|
InsufficientScopeChallengeHandler(String realm)
Builds a new InsufficientScopeChallengeHandler with a default description, no error URI page and no scopes.
|
InsufficientScopeChallengeHandler(String realm,
Set<String> scopes)
Builds a new InsufficientScopeChallengeHandler with a default description and no error URI page.
|
InsufficientScopeChallengeHandler(String realm,
Set<String> scopes,
String insufficientScopeUri)
Builds a new InsufficientScopeChallengeHandler with a default description.
|
InsufficientScopeChallengeHandler(String realm,
String description,
Set<String> scopes,
String insufficientScopeUri)
Builds a new InsufficientScopeChallengeHandler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendExtraAttributes(StringBuilder sb)
Permits sub-classes to append extra attributes to the challenge.
|
protected Response |
createResponse()
Creates a
Response with the appropriate status code and reason. |
handle
public InsufficientScopeChallengeHandler(String realm)
realm
- mandatory realm value.public InsufficientScopeChallengeHandler(String realm, Set<String> scopes)
realm
- mandatory realm value.scopes
- List of required scopes (will be omitted if empty)public InsufficientScopeChallengeHandler(String realm, Set<String> scopes, String insufficientScopeUri)
realm
- mandatory realm value.scopes
- List of required scopes (will be omitted if empty)insufficientScopeUri
- error uri page (will be omitted if null)public InsufficientScopeChallengeHandler(String realm, String description, Set<String> scopes, String insufficientScopeUri)
realm
- mandatory realm value.description
- error description (will be omitted if null)scopes
- List of required scopes (will be omitted if empty)insufficientScopeUri
- error uri page (will be omitted if null)protected Response createResponse()
AuthenticateChallengeHandler
Response
with the appropriate status code and reason. This method is called each time the
AuthenticateChallengeHandler.handle(Context, Request)
method is invoked.createResponse
in class AuthenticateChallengeHandler
Response
instanceprotected void appendExtraAttributes(StringBuilder sb)
AuthenticateChallengeHandler
appendExtraAttributes
in class AuthenticateChallengeHandler
sb
- Challenge valueCopyright 2011-2015 ForgeRock AS.