Class WebCredentialPresenter

java.lang.Object
org.astrogrid.samp.web.WebCredentialPresenter
All Implemented Interfaces:
CredentialPresenter

public class WebCredentialPresenter extends 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.
and the following HTTP headers:
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
  • Field Details

  • 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 interface CredentialPresenter
      Parameters:
      request - HTTP request associated with the registration request
      securityMap - information explicitly supplied by the aspiring client in support of its application to register
      authContent - content of AuthResourceBundle bundle
      Returns:
      items for presentation to the user
      Throws:
      SampException - if credentials should definitely not be accepted