Class X509LoginMethodFragment
java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509LoginMethodFragment
- All Implemented Interfaces:
LoginMethodFragment
Contributes the sign-in with a client certificate to the login page: a form with one button that posts, with the
CSRF token, to
POST /login/x509. The template reads action() through this bean, because where the
form posts depends on the transport:
- with a proxy that forwards the certificate, the proxy fronts the whole application, so the form posts to the relative path, on the origin of the page;
- with only the dedicated TLS port, the certificate is requested by that port alone, so a page served on any
other port posts to the same host on that port over
https; a page already served on that port posts to the relative path.
SameSite restriction on a post between pages of the same site, and it
counts http and https as different sites: the main port must be served over https too, or
the login page must be opened on the TLS port. The bean only exists while the sign-in with a certificate is enabled.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringScheme of the dedicated TLS port.static final intPosition of the certificate sign-in in the login page: after the social one, before the one-time tokens.private final X509PropertiesSettings, which tell the transports and the TLS port. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Gets the address the form of the page being rendered posts to.action(jakarta.servlet.http.HttpServletRequest request) Gets the address the form of a page posts to.Gets the fragment of the template.intorder()Gets the position of the fragment.Gets the template that holds the fragment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.irurueta.authserver.authorization.api.web.login.LoginMethodFragment
reference
-
Field Details
-
ORDER
public static final int ORDERPosition of the certificate sign-in in the login page: after the social one, before the one-time tokens.- See Also:
-
HTTPS
Scheme of the dedicated TLS port.- See Also:
-
properties
Settings, which tell the transports and the TLS port.
-
-
Constructor Details
-
X509LoginMethodFragment
Creates the fragment.- Parameters:
properties- settings of the sign-in with a certificate.
-
-
Method Details
-
templateName
Gets the template that holds the fragment.- Specified by:
templateNamein interfaceLoginMethodFragment- Returns:
login-x509.
-
fragmentName
Gets the fragment of the template.- Specified by:
fragmentNamein interfaceLoginMethodFragment- Returns:
login.
-
order
public int order()Gets the position of the fragment.- Specified by:
orderin interfaceLoginMethodFragment- Returns:
ORDER.
-
action
Gets the address the form of the page being rendered posts to.- Returns:
- the address of the sign-in request for the current request; the relative path when there is none.
-
action
Gets the address the form of a page posts to.- Parameters:
request- the request of the page.- Returns:
- the relative path (with the context path) when a proxy forwards the certificate, when there is no TLS port or when the page is served on it; otherwise the absolute address on the TLS port of the same host.
-