001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * docs/licenses/cddl.txt
011 * or http://www.opensource.org/licenses/cddl1.php.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * docs/licenses/cddl.txt.  If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 *      Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 *      Copyright 2016-2017 Ping Identity Corporation
026 */
027
028package com.unboundid.directory.sdk.broker.types;
029
030import com.unboundid.util.NotExtensible;
031
032import javax.servlet.http.HttpServletRequest;
033
034
035
036/**
037 * Represents an authentication request to be processed by a Server SDK
038 * Identity Authenticator.
039 */
040@NotExtensible
041public interface AuthenticationRequest
042{
043  /**
044   * Retrieve the currently authenticated principal or
045   * {@code null} if not available.
046   *
047   * @return  The currently authenticated principal or
048   *          {@code null} if not available.
049   */
050  ScimResourcePrincipal getPrincipal();
051
052
053
054  /**
055   * Retrieve a JSON object specifying the request parameters containing
056   * credentials that may be used to authenticate an end-user.
057   * This string can be parsed using any JSON library. For example,
058   * Jackson's ObjectMapper.readTree() or the UnboundID LDAP SDK's JSONObject
059   * constructor.
060   *
061   * @return  The request parameters containing credentials that may be
062   *          used to authenticate an end-user.
063   */
064  String getRequestParameters();
065
066
067
068  /**
069   * Retrieve a JSON object specifying the flow state parameters.
070   * Never {@code null}.
071   * This string can be parsed using any JSON library. For example,
072   * Jackson's ObjectMapper.readTree() or the UnboundID LDAP SDK's JSONObject
073   * constructor.
074   *
075   * @return  A JSON object specifying the flow state parameters.
076   */
077  String getStateParameters();
078
079
080
081  /**
082   * Retrieve the HTTP servlet request for the request being processed.
083   * @return  The HTTP servlet request for the request being processed.
084   */
085  HttpServletRequest getHttpServletRequest();
086}