Package org.astrogrid.samp.web
Class WebCredentialPresenter
- java.lang.Object
-
- org.astrogrid.samp.web.WebCredentialPresenter
-
- All Implemented Interfaces:
CredentialPresenter
public class WebCredentialPresenter extends java.lang.Object implements CredentialPresenter
CredentialPresenter for use with the Web Profile.Uses the following securityMap items:
- samp.name:
- Self-declared client name. Mandatory, but since it's supplied by the client, it doesn't tell you anything trustworthy.
- Origin:
- Application origin, present if CORS is in use. See Cross-Origin Resource Sharing, The Web Origin Concept (RFC 6454).
- Referer:
- Connection URL, present at whim of browser. See HTTP/1.1 (RFC2616), sec 14.36.
The sole instance of this singleton class is
INSTANCE
.- Since:
- 20 Jun 2016
- Author:
- Mark Taylor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.astrogrid.samp.web.CredentialPresenter
CredentialPresenter.Presentation
-
-
Field Summary
Fields Modifier and Type Field Description static WebCredentialPresenter
INSTANCE
Singleton instance.static java.lang.String
ORIGIN_HDR
Origin header.static java.lang.String
REFERER_HDR
Referer header.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CredentialPresenter.Presentation
createPresentation(HttpServer.Request request, java.util.Map securityMap, AuthResourceBundle.Content authContent)
Returns an object which contains user-directed credential messages, given available information from the registration request.
-
-
-
Field Detail
-
INSTANCE
public static final WebCredentialPresenter INSTANCE
Singleton instance.
-
ORIGIN_HDR
public static final java.lang.String ORIGIN_HDR
Origin header.- See Also:
- Constant Field Values
-
REFERER_HDR
public static final java.lang.String REFERER_HDR
Referer header.- See Also:
- Constant Field Values
-
-
Method Detail
-
createPresentation
public CredentialPresenter.Presentation createPresentation(HttpServer.Request request, java.util.Map securityMap, AuthResourceBundle.Content authContent) throws SampException
Description copied from interface:CredentialPresenter
Returns an object which contains user-directed credential messages, given available information from the registration request. If the request or securityMap can be determined to be definitely unsuitable for registration, a SampException is thrown.- Specified by:
createPresentation
in interfaceCredentialPresenter
- Parameters:
request
- HTTP request associated with the registration requestsecurityMap
- information explicitly supplied by the aspiring client in support of its application to registerauthContent
- content of AuthResourceBundle bundle- Returns:
- items for presentation to the user
- Throws:
SampException
- if credentials should definitely not be accepted
-
-