Package org.astrogrid.samp.web
Class WebCredentialPresenter
java.lang.Object
org.astrogrid.samp.web.WebCredentialPresenter
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final WebCredentialPresenter
Singleton instance.static final String
Origin header.static final String
Referer header. -
Method Summary
Modifier and TypeMethodDescriptioncreatePresentation
(HttpServer.Request request, Map securityMap, AuthResourceBundle.Content authContent) Returns an object which contains user-directed credential messages, given available information from the registration request.
-
Field Details
-
INSTANCE
Singleton instance. -
ORIGIN_HDR
Origin header.- See Also:
-
REFERER_HDR
Referer header.- See Also:
-
-
Method Details
-
createPresentation
public CredentialPresenter.Presentation createPresentation(HttpServer.Request request, 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
-