Class NimbusClientSupport
java.lang.Object
net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientSupport
Helper methods for working with Duo using Nimbus.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringCreate a signed JWT using the audience and client ID supplied.(package private) static StringcreateJWSRequestObject(String clientID, String redirectURI, String secret, String state, String username) Create a signed JWT Request object using the given parameters suitable for the Duo token endpoint.(package private) static StringgenerateJWTId(Integer length) Generate a cryptographically strong random JWT identifier.
-
Constructor Details
-
NimbusClientSupport
private NimbusClientSupport()private constructor.
-
-
Method Details
-
generateJWTId
Generate a cryptographically strong random JWT identifier.- Parameters:
length- the length of the ID. Can not benull.- Returns:
- a cryptographically strong random JWT identifier.
-
createJWSRequestObject
@Nonnull static String createJWSRequestObject(@Nonnull @NotEmpty String clientID, @Nonnull @NotEmpty String redirectURI, @Nonnull @NotEmpty String secret, @Nonnull @NotEmpty String state, @Nonnull @NotEmpty String username) throws DuoClientException Create a signed JWT Request object using the given parameters suitable for the Duo token endpoint.Only supports the HS512 JWS algorithm.
- Parameters:
clientID- the client identifierredirectURI- the redirectURIsecret- the client secretstate- the stateusername- the subject of the authentication- Returns:
- a signed JWT
- Throws:
DuoClientException- on error constructing the JWS request object
-
createJWS
@Nonnull static String createJWS(@Nonnull String aud, @Nonnull String clientID, @Nonnull String secret) throws DuoClientException Create a signed JWT using the audience and client ID supplied.Only supports the HS512 JWS algorithm.
- Parameters:
aud- the audience of the JWT.clientID- the client identifiersecret- the client secret- Returns:
- a signed JWT.
- Throws:
DuoClientException- on error constructing the JWS object
-