Class BearerAuthenticationChallenge
java.lang.Object
com.soklet.BearerAuthenticationChallenge
An immutable RFC 6750 Bearer challenge with an RFC 9728 protected-resource
metadata URL.
getHeaderValue() renders one WWW-Authenticate
field value, without the field name. Constructing a challenge validates its
syntax; the application remains responsible for publishing the metadata and
choosing scopes its authorization server can grant.- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder for one immutable Bearer challenge. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the validated challenge fields.getError()getRealm()Returns the RFC-recommended HTTP status for this challenge: 400 for an invalid request, 403 for insufficient scope, and 401 otherwise.inthashCode()toString()withResourceMetadataUri(@NonNull URI resourceMetadataUri)
-
Method Details
-
withResourceMetadataUri
public static @NonNull BearerAuthenticationChallenge.Builder withResourceMetadataUri(@NonNull URI resourceMetadataUri) - Returns:
- a builder with the configured protected-resource metadata URL
-
getResourceMetadataUri
- Returns:
- the configured absolute protected-resource metadata URI
-
getError
- Returns:
- the RFC 6750 Bearer error, when supplied
-
getRequiredScopes
- Returns:
- immutable scope tokens in first-encounter order
-
getRealm
-
getErrorDescription
- Returns:
- the developer-facing error description, when supplied
-
getErrorUri
- Returns:
- the error explanation URI, when supplied
-
getRecommendedStatusCode
Returns the RFC-recommended HTTP status for this challenge: 400 for an invalid request, 403 for insufficient scope, and 401 otherwise.- Returns:
- recommended HTTP status
-
getHeaderValue
- Returns:
- the complete
WWW-Authenticatefield value
-
equals
-
hashCode
-
toString
-