001/*
002 * oauth2-oidc-sdk
003 *
004 * Copyright 2012-2016, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.openid.connect.sdk.claims;
019
020
021import net.jcip.annotations.Immutable;
022
023import com.nimbusds.oauth2.sdk.id.Identifier;
024
025
026/**
027 * Authentication Context Class Reference ({@code acr}). It identifies the 
028 * authentication context, i.e. the information that the relying party may 
029 * require before it makes an entitlements decision with respect to an 
030 * authentication response. Such context may include, but is not limited to, 
031 * the actual authentication method used or level of assurance such as 
032 * ITU-T X.1254 | ISO/IEC 29115 entity authentication assurance level.
033 *
034 * <p>The ACR is represented by a string or an URI string.
035 *
036 * <p>Related specifications:
037 *
038 * <ul>
039 *     <li>OpenID Connect Core 1.0, section 2.
040 *     <li>OpenID Connect Extended Authentication Profile (EAP) ACR Values 1.0
041 *         - draft 00
042 *     <li>RFC 6711
043 *     <li>See ISO/IEC DIS 29115
044 * </ul>
045 */
046@Immutable
047public final class ACR extends Identifier {
048        
049        
050        /**
051         * Phishing-Resistant. An authentication mechanism where a party
052         * potentially under the control of the Relying Party cannot gain
053         * sufficient information to be able to successfully authenticate to
054         * the End User's OpenID Provider as if that party were the End User.
055         * (Note that the potentially malicious Relying Party controls where
056         * the User-Agent is redirected to and thus may not send it to the End
057         * User's actual OpenID Provider). NOTE: These semantics are the same
058         * as those specified in [OpenID.PAPE].
059         */
060        public static final ACR PHR = new ACR("phr");
061        
062        
063        /**
064         * Phishing-Resistant Hardware-Protected. An authentication mechanism
065         * meeting the requirements for phishing-resistant {@link #PHR}
066         * authentication in which additionally information needed to be able
067         * to successfully authenticate to the End User's OpenID Provider as if
068         * that party were the End User is held in a hardware-protected device
069         * or component.
070         */
071        public static final ACR PHRH = new ACR("phrh");
072        
073        
074        /**
075         * Creates a new Authentication Context Class Reference (ACR) with the
076         * specified value.
077         *
078         * @param value The ACR value. Must not be {@code null}.
079         */
080        public ACR(final String value) {
081        
082                super(value);
083        }
084
085
086        @Override
087        public boolean equals(final Object object) {
088        
089                return object instanceof ACR &&
090                       this.toString().equals(object.toString());
091        }
092}