Class AuthBuilder
java.lang.Object
org.sdase.commons.server.auth.testing.AuthBuilder
The
AuthBuilder
is used to build JWT authentication in test cases that is accepted by the
tested application if the test is initialized with the AuthClassExtension
. Properly
configured instances of the AuthBuilder
can be created from the AuthClassExtension
using AuthClassExtension.auth()
within the test.-
Method Summary
-
Method Details
-
withIssuer
-
withSubject
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaim
-
addClaims
-
buildToken
- Returns:
- the signed and encoded token, e.g.
eyXXX.eyYYY.ZZZ
-
buildHeaderValue
- Returns:
- the signed and encoded token with
Bearer
prefix to be used directly asAuthorization
header value, e.g.Bearer eyXXX.eyYYY.ZZZ
-
buildAuthHeader
- Returns:
- a map with a trusted
Authorization
header to be used withInvocation.Builder.headers(MultivaluedMap)
-