Class OIDCProxySupport
java.lang.Object
net.shibboleth.idp.plugin.authn.oidc.rp.impl.OIDCProxySupport
Support class for OIDC proxy related implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractKeyFromState(String state) Extract the key component from the state.static StringextractNonceFromState(String state) Extract the nonce component from the state.static StringgenerateNonce(Integer length) Generates a random identifier to be used as a nonce.static StringgenerateState(String nonce, String key) Generate a state parameter from a nonce component and an execution key component.
-
Constructor Details
-
OIDCProxySupport
private OIDCProxySupport()Private constructor.
-
-
Method Details
-
generateNonce
Generates a random identifier to be used as a nonce.- Parameters:
length- the length of the parameter.- Returns:
- the randomly generated nonce value.
-
generateState
Generate a state parameter from a nonce component and an execution key component.
The nonce is separated from the key by a dot e.g. <nonce>.<keyHex>.
The nonce is assumed to be already encoded in its transmission format e.g. Hex. The key is hex encoded before it is combined with the nonce. The result is assumed URL encoded e.g. inside the allowed set of URI characters or, no character in the state is from the URI reserved set.
- Parameters:
nonce- the nonce component.key- the key component. The key is hex encoded before it is added to the generated state.- Returns:
- the combined state component.
-
extractKeyFromState
Extract the key component from the state. The key is hex encoded and separated from the nonce value by a dot.- Parameters:
state- the state which contains both the nonce and the key dot separated.- Returns:
- the key extracted from the state and hex decoded.
- Throws:
OIDCProxyException- if the key component can not be found, or hex decoding fails.
-
extractNonceFromState
@Nonnull public static String extractNonceFromState(@Nonnull String state) throws OIDCProxyException Extract the nonce component from the state. The nonce is separated from the key by a dot, and is assumed to be the first value of the pair.- Parameters:
state- the state which contains both the nonce and the key dot separated.- Returns:
- the nonce extracted from the state.
- Throws:
OIDCProxyException- if the nonce component can not be found.
-