001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2008 Sun Microsystems, Inc. 015 */ 016package org.forgerock.opendj.server.config.client; 017 018 019 020import java.util.Collection; 021import java.util.SortedSet; 022import org.forgerock.opendj.config.ManagedObjectDefinition; 023import org.forgerock.opendj.config.PropertyException; 024import org.forgerock.opendj.server.config.server.HTTPOauth2AuthorizationMechanismCfg; 025 026 027 028/** 029 * A client-side interface for reading and modifying HTTP Oauth2 030 * Authorization Mechanism settings. 031 * <p> 032 * The HTTP Oauth2 Authorization Mechanism is used to define HTTP 033 * OAuth2 authorization mechanism. 034 */ 035public interface HTTPOauth2AuthorizationMechanismCfgClient extends HTTPAuthorizationMechanismCfgClient { 036 037 /** 038 * Get the configuration definition associated with this HTTP Oauth2 Authorization Mechanism. 039 * 040 * @return Returns the configuration definition associated with this HTTP Oauth2 Authorization Mechanism. 041 */ 042 ManagedObjectDefinition<? extends HTTPOauth2AuthorizationMechanismCfgClient, ? extends HTTPOauth2AuthorizationMechanismCfg> definition(); 043 044 045 046 /** 047 * Gets the "access-token-cache-enabled" property. 048 * <p> 049 * Indicates whether the HTTP Oauth2 Authorization Mechanism is 050 * enabled for use. 051 * 052 * @return Returns the value of the "access-token-cache-enabled" property. 053 */ 054 boolean isAccessTokenCacheEnabled(); 055 056 057 058 /** 059 * Sets the "access-token-cache-enabled" property. 060 * <p> 061 * Indicates whether the HTTP Oauth2 Authorization Mechanism is 062 * enabled for use. 063 * 064 * @param value The value of the "access-token-cache-enabled" property. 065 * @throws PropertyException 066 * If the new value is invalid. 067 */ 068 void setAccessTokenCacheEnabled(boolean value) throws PropertyException; 069 070 071 072 /** 073 * Gets the "access-token-cache-expiration" property. 074 * <p> 075 * Token cache expiration 076 * 077 * @return Returns the value of the "access-token-cache-expiration" property. 078 */ 079 Long getAccessTokenCacheExpiration(); 080 081 082 083 /** 084 * Sets the "access-token-cache-expiration" property. 085 * <p> 086 * Token cache expiration 087 * 088 * @param value The value of the "access-token-cache-expiration" property. 089 * @throws PropertyException 090 * If the new value is invalid. 091 */ 092 void setAccessTokenCacheExpiration(Long value) throws PropertyException; 093 094 095 096 /** 097 * Gets the "authzid-json-pointer" property. 098 * <p> 099 * Specifies the JSON pointer to the value to use as Authorization 100 * ID. The JSON pointer is applied to the resolved access token JSON 101 * document. (example: /uid) 102 * 103 * @return Returns the value of the "authzid-json-pointer" property. 104 */ 105 String getAuthzidJsonPointer(); 106 107 108 109 /** 110 * Sets the "authzid-json-pointer" property. 111 * <p> 112 * Specifies the JSON pointer to the value to use as Authorization 113 * ID. The JSON pointer is applied to the resolved access token JSON 114 * document. (example: /uid) 115 * 116 * @param value The value of the "authzid-json-pointer" property. 117 * @throws PropertyException 118 * If the new value is invalid. 119 */ 120 void setAuthzidJsonPointer(String value) throws PropertyException; 121 122 123 124 /** 125 * Gets the "identity-mapper" property. 126 * <p> 127 * > Specifies the name of the identity mapper to use in conjunction 128 * with the authzid-json-pointer to get the user corresponding to the 129 * acccess-token. 130 * 131 * @return Returns the value of the "identity-mapper" property. 132 */ 133 String getIdentityMapper(); 134 135 136 137 /** 138 * Sets the "identity-mapper" property. 139 * <p> 140 * > Specifies the name of the identity mapper to use in conjunction 141 * with the authzid-json-pointer to get the user corresponding to the 142 * acccess-token. 143 * 144 * @param value The value of the "identity-mapper" property. 145 * @throws PropertyException 146 * If the new value is invalid. 147 */ 148 void setIdentityMapper(String value) throws PropertyException; 149 150 151 152 /** 153 * Gets the "required-scope" property. 154 * <p> 155 * Scopes required to grant access to the service. 156 * 157 * @return Returns the values of the "required-scope" property. 158 */ 159 SortedSet<String> getRequiredScope(); 160 161 162 163 /** 164 * Sets the "required-scope" property. 165 * <p> 166 * Scopes required to grant access to the service. 167 * 168 * @param values The values of the "required-scope" property. 169 * @throws PropertyException 170 * If one or more of the new values are invalid. 171 */ 172 void setRequiredScope(Collection<String> values) throws PropertyException; 173 174}