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.oauth2.sdk.auth; 019 020 021import com.nimbusds.oauth2.sdk.id.ClientID; 022 023import java.util.Objects; 024 025 026/** 027 * Base abstract class for plain secret based client authentication at the 028 * Token endpoint. 029 * 030 * <p>Related specifications: 031 * 032 * <ul> 033 * <li>OAuth 2.0 (RFC 6749) 034 * <li>OpenID Connect Core 1.0 035 * </ul> 036 */ 037public abstract class PlainClientSecret extends ClientAuthentication { 038 039 040 /** 041 * The client secret. 042 */ 043 private final Secret secret; 044 045 046 /** 047 * Creates a new plain secret based client authentication. 048 * 049 * @param method The client authentication method. Must not be 050 * {@code null}. 051 * @param clientID The client identifier. Must not be {@code null}. 052 * @param secret The client secret. Must not be {@code null}. 053 */ 054 protected PlainClientSecret(final ClientAuthenticationMethod method, 055 final ClientID clientID, 056 final Secret secret) { 057 058 super(method, clientID); 059 this.secret = Objects.requireNonNull(secret); 060 } 061 062 063 /** 064 * Gets the client secret. 065 * 066 * @return The client secret. 067 */ 068 public Secret getClientSecret() { 069 070 return secret; 071 } 072}