Class OttLinkFactory
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.OttLinkFactory
Builds the magic link of a token. It points at the confirmation page (
GET /login/ott/confirm), whose button
posts the token, and never at an endpoint that consumes it, so a mail scanner that opens the link does not use it
up. The host is the configured issuer of this server, never the Host header of the request that asked for the
link, which an attacker controls: a link built from it could carry the token of somebody else to another host.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOttLinkFactory(org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings settings) Creates the factory. -
Method Summary
Modifier and TypeMethodDescriptionconfirmationLink(String tokenValue) Builds the link of a token.
-
Field Details
-
TOKEN_PARAMETER
Name of the query parameter that carries the token.- See Also:
-
issuer
Public base URL of this server, the issuer of the tokens.
-
-
Constructor Details
-
OttLinkFactory
public OttLinkFactory(org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings settings) Creates the factory.- Parameters:
settings- settings of the authorization server, whose issuer (spring.security.oauth2.authorizationserver.issuer) is the base of the links.- Throws:
IllegalStateException- if no issuer is configured: a link built from the request would trust itsHostheader.
-
-
Method Details
-
confirmationLink
Builds the link of a token.- Parameters:
tokenValue- value of the token.- Returns:
- the link to the confirmation page.
-