001package ca.cdr.api.model.json.oauth; 002 003import ca.cdr.api.model.json.IModelJson; 004import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; 005import com.fasterxml.jackson.annotation.JsonAnySetter; 006import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import com.fasterxml.jackson.core.JsonProcessingException; 009import com.fasterxml.jackson.databind.ObjectMapper; 010import io.swagger.v3.oas.annotations.media.Schema; 011 012import java.lang.reflect.Field; 013import java.util.ArrayList; 014import java.util.HashMap; 015import java.util.List; 016import java.util.Map; 017 018/** 019 * @deprecated Use ca.cdr.api.model.json.oauth.OpenIdWellKnownOpenIdConfigurationResponseJson 020 */ 021@JsonIgnoreProperties(ignoreUnknown = true) 022@Schema( 023 name = "OpenIdWellKnownOpenIdConfigurationResponse", 024 description = "This object represents the response from an Identity Provider's .well-known endpoint.") 025public class OpenIdWellKnownOpenIdConfigurationResponseJson implements IModelJson { 026 027 /* CHECKSTYLE.OFF: RegexpSingleLine - these json property names are spec compliant and should not be changed */ 028 029 /** 030 * Authorization server's issuer identifier url 031 */ 032 @JsonProperty(value = "issuer", required = true) 033 private String myIssuer; 034 035 /** 036 * URL of the authorization server's authorization endpoint 037 * REQUIRED unless no grant types are supported that use authorization endpoint 038 */ 039 @JsonProperty("authorization_endpoint") 040 private String myAuthorizationEndpoint; 041 042 /** 043 * URL of the auth server's token endpoint 044 * REQUIRED unless only the implicit grant type is supported 045 */ 046 @JsonProperty("token_endpoint") 047 private String myTokenEndpoint; 048 049 /** 050 * JSON array of subject identifier types that this OP supports 051 * (pairwise, public) 052 */ 053 @JsonProperty(value = "subject_types_supported", required = true) 054 private List<String> mySubjectTypesSupported; 055 056 /** 057 * URL of the auth server's JWK Set document 058 */ 059 @JsonProperty(value = "jwks_uri", required = false) 060 private String myJwkUri; 061 062 /** 063 * URL of the auth server's OAuth 2.0 Dynamic Client Registration Endpoint 064 */ 065 @JsonProperty(value = "registration_endpoint", required = false) 066 private String myDynamicClientRegistrationEndpoint; 067 068 /** 069 * JSON array containing a list of the OAuth 2.0 "scopes" values that this auth 070 * server supports. 071 * RECOMMENDED 072 */ 073 @JsonProperty("scopes_supported") 074 private List<String> mySupportedScopes; 075 076 /** 077 * JSON array containing a list of the oauth 2.0 "response_type" values 078 * that this auth server supports. 079 */ 080 @JsonProperty(value = "response_types_supported", required = true) 081 private List<String> mySupportedResponseTypes; 082 083 /** 084 * JSON array containing a list of the oauth 2.0 "response_mode" values that this 085 * auth server supports 086 */ 087 @JsonProperty(value = "response_modes_supported", required = false) 088 private List<String> mySupportedResponseModes; 089 090 /** 091 * JSON array containing a list of the oauth 092 * 2.0 grant type values that this auth server supports 093 */ 094 @JsonProperty(value = "grant_types_supported", required = false) 095 private List<String> mySupportedGrantTypes; 096 097 /** 098 * JSON array containing a list of the client authentication methods supported by this token 099 * endpoint 100 */ 101 @JsonProperty(value = "token_endpoint_auth_methods_supported", required = false) 102 private List<String> mySupportedAuthenticationMethods; 103 104 /** 105 * JSON array of list of the JWS Signing algorithms supported by 106 * the token endpoint for the signature on the JWT used 107 * to authenticate the client at the token endpoint 108 */ 109 @JsonProperty(value = "token_endpoint_auth_signing_alg_values_supported", required = false) 110 private List<String> mySupportedJWSSigningAlgorithms; 111 112 /** 113 * URL of the auth server's oauth 2.0 114 * revocation endpoint 115 */ 116 @JsonProperty(value = "revocation_endpoint", required = false) 117 private String myRevocationEndpoint; 118 119 /** 120 * JSON array of client auth methods supported by this 121 * revocation endpoint. 122 */ 123 @JsonProperty(value = "revocation_endpoint_auth_methods_supported", required = false) 124 private List<String> mySupportedAuthMethodsForRevocation; 125 126 /** 127 * JSON array of the JWS signing algorithms supported by the 128 * revocation endpoint for the signature on the JWT used to authenticate the client. 129 */ 130 @JsonProperty(value = "revocation_endpoint_auth_signing_alg_values_supported", required = false) 131 private List<String> myRevocationEndpointSigningAlgorithms; 132 133 /** 134 * URL of the auth server's oauth2.0 introspection endpoint 135 */ 136 @JsonProperty(value = "introspection_endpoint", required = false) 137 private String myIntrospectionEndpoint; 138 139 /** 140 * JSON array of the client auth methods supported by this introspection 141 * endpoint. 142 */ 143 @JsonProperty(value = "introspection_endpoint_auth_methods_supported", required = false) 144 private List<String> mySupportedIntrospectionEndpointAuthMethods; 145 146 /** 147 * User info url. 148 * RECOMMENDED 149 */ 150 @JsonProperty("userinfo_endpoint") 151 private String myUserInfoEndpoint; 152 153 /** 154 * JSON array of signing algs supported for id token 155 */ 156 @JsonProperty(value = "id_token_signing_alg_values_supported", required = true) 157 private List<String> mySupportedIdTokenSigningAlgs; 158 159 /** 160 * JSON array containing a list of proof key for code exchange (PCKE flow) code 161 * challenge methods supported by this auth server 162 */ 163 @JsonProperty(value = "code_challenge_methods_supported", required = false) 164 private List<String> myCodeChallengeMethodsSupported; 165 166 /* CHECKSTYLE.ON: RegexpSingleLine */ 167 168 /** 169 * We will store all unknown properties in a map during deserialization; 170 * if these properties are not in fact "unknown" but part of the spec, 171 * please add them above, but leave this map. 172 */ 173 private final Map<String, Object> myUnknownProperties = new HashMap<>(); 174 175 public String getIssuer() { 176 return myIssuer; 177 } 178 179 public void setIssuer(String theIssuer) { 180 myIssuer = theIssuer; 181 } 182 183 public String getAuthorizationEndpoint() { 184 return myAuthorizationEndpoint; 185 } 186 187 public void setAuthorizationEndpoint(String theAuthorizationEndpoint) { 188 myAuthorizationEndpoint = theAuthorizationEndpoint; 189 } 190 191 public String getTokenEndpoint() { 192 return myTokenEndpoint; 193 } 194 195 public void setTokenEndpoint(String theTokenEndpoint) { 196 myTokenEndpoint = theTokenEndpoint; 197 } 198 199 public String getJwkUri() { 200 return myJwkUri; 201 } 202 203 public void setJwkUri(String theJwkUri) { 204 myJwkUri = theJwkUri; 205 } 206 207 public String getDynamicClientRegistrationEndpoint() { 208 return myDynamicClientRegistrationEndpoint; 209 } 210 211 public void setDynamicClientRegistrationEndpoint(String theDynamicClientRegistrationEndpoint) { 212 myDynamicClientRegistrationEndpoint = theDynamicClientRegistrationEndpoint; 213 } 214 215 public List<String> getSupportedScopes() { 216 if (mySupportedScopes == null) { 217 mySupportedScopes = new ArrayList<>(); 218 } 219 return mySupportedScopes; 220 } 221 222 public void setSupportedScopes(List<String> theSupportedScopes) { 223 mySupportedScopes = theSupportedScopes; 224 } 225 226 public void addSupportedScope(String theScope) { 227 getSupportedScopes().add(theScope); 228 } 229 230 public List<String> getSupportedResponseTypes() { 231 if (mySupportedResponseTypes == null) { 232 mySupportedResponseTypes = new ArrayList<>(); 233 } 234 return mySupportedResponseTypes; 235 } 236 237 public void setSupportedResponseTypes(List<String> theSupportedResponseTypes) { 238 mySupportedResponseTypes = theSupportedResponseTypes; 239 } 240 241 public void addSupportedResponseType(String theResponseType) { 242 getSupportedResponseTypes().add(theResponseType); 243 } 244 245 public List<String> getSupportedResponseModes() { 246 if (mySupportedResponseModes == null) { 247 mySupportedResponseModes = new ArrayList<>(); 248 } 249 return mySupportedResponseModes; 250 } 251 252 public void setSupportedResponseModes(List<String> theSupportedResponseModes) { 253 mySupportedResponseModes = theSupportedResponseModes; 254 } 255 256 public void addSupportedResponseMode(String theMode) { 257 getSupportedResponseModes().add(theMode); 258 } 259 260 public List<String> getSupportedGrantTypes() { 261 if (mySupportedGrantTypes == null) { 262 mySupportedGrantTypes = new ArrayList<>(); 263 } 264 return mySupportedGrantTypes; 265 } 266 267 public void setSupportedGrantTypes(List<String> theSupportedGrantTypes) { 268 mySupportedGrantTypes = theSupportedGrantTypes; 269 } 270 271 public void addSupportedGrantType(String theGrantType) { 272 getSupportedGrantTypes().add(theGrantType); 273 } 274 275 public List<String> getSupportedAuthenticationMethods() { 276 if (mySupportedAuthenticationMethods == null) { 277 mySupportedAuthenticationMethods = new ArrayList<>(); 278 } 279 return mySupportedAuthenticationMethods; 280 } 281 282 public void setSupportedAuthenticationMethods(List<String> theSupportedAuthenticationMethods) { 283 mySupportedAuthenticationMethods = theSupportedAuthenticationMethods; 284 } 285 286 public void addSupportedAuthenticationMethod(String theMethod) { 287 getSupportedAuthenticationMethods().add(theMethod); 288 } 289 290 public List<String> getSupportedJWSSigningAlgorithms() { 291 if (mySupportedJWSSigningAlgorithms == null) { 292 mySupportedJWSSigningAlgorithms = new ArrayList<>(); 293 } 294 return mySupportedJWSSigningAlgorithms; 295 } 296 297 public void setSupportedJWSSigningAlgorithms(List<String> theSupportedJWSSigningAlgorithms) { 298 mySupportedJWSSigningAlgorithms = theSupportedJWSSigningAlgorithms; 299 } 300 301 public void addSupportedJWSSigningAlgorithm(String theAlg) { 302 getSupportedJWSSigningAlgorithms().add(theAlg); 303 } 304 305 public String getRevocationEndpoint() { 306 return myRevocationEndpoint; 307 } 308 309 public void setRevocationEndpoint(String theRevocationEndpoint) { 310 myRevocationEndpoint = theRevocationEndpoint; 311 } 312 313 public List<String> getSupportedAuthMethodsForRevocation() { 314 if (mySupportedAuthMethodsForRevocation == null) { 315 mySupportedAuthMethodsForRevocation = new ArrayList<>(); 316 } 317 return mySupportedAuthMethodsForRevocation; 318 } 319 320 public void setSupportedAuthMethodsForRevocation(List<String> theSupportedAuthMethodsForRevocation) { 321 mySupportedAuthMethodsForRevocation = theSupportedAuthMethodsForRevocation; 322 } 323 324 public void addSupportedAuthMethodForRevocation(String theMethod) { 325 getSupportedAuthenticationMethods().add(theMethod); 326 } 327 328 public List<String> getRevocationEndpointSigningAlgorithms() { 329 if (myRevocationEndpointSigningAlgorithms == null) { 330 myRevocationEndpointSigningAlgorithms = new ArrayList<>(); 331 } 332 return myRevocationEndpointSigningAlgorithms; 333 } 334 335 public void setRevocationEndpointSigningAlgorithms(List<String> theRevocationEndpointSigningAlgorithms) { 336 myRevocationEndpointSigningAlgorithms = theRevocationEndpointSigningAlgorithms; 337 } 338 339 public void addRevocationEndpointSigningAlgorithm(String theAlg) { 340 getRevocationEndpointSigningAlgorithms().add(theAlg); 341 } 342 343 public String getIntrospectionEndpoint() { 344 return myIntrospectionEndpoint; 345 } 346 347 public void setIntrospectionEndpoint(String theIntrospectionEndpoint) { 348 myIntrospectionEndpoint = theIntrospectionEndpoint; 349 } 350 351 public List<String> getSupportedIntrospectionEndpointAuthMethods() { 352 if (mySupportedIntrospectionEndpointAuthMethods == null) { 353 mySupportedIntrospectionEndpointAuthMethods = new ArrayList<>(); 354 } 355 return mySupportedIntrospectionEndpointAuthMethods; 356 } 357 358 public void setSupportedIntrospectionEndpointAuthMethods( 359 List<String> theSupportedIntrospectionEndpointAuthMethods) { 360 mySupportedIntrospectionEndpointAuthMethods = theSupportedIntrospectionEndpointAuthMethods; 361 } 362 363 public void addSupportedIntrospectionEndpointAuthMethod(String theMethod) { 364 getSupportedIntrospectionEndpointAuthMethods().add(theMethod); 365 } 366 367 public String getUserInfoEndpoint() { 368 return myUserInfoEndpoint; 369 } 370 371 public void setUserInfoEndpoint(String theUserInfoEndpoint) { 372 myUserInfoEndpoint = theUserInfoEndpoint; 373 } 374 375 public List<String> getSupportedIdTokenSigningAlgs() { 376 if (mySupportedIdTokenSigningAlgs == null) { 377 mySupportedIdTokenSigningAlgs = new ArrayList<>(); 378 } 379 return mySupportedIdTokenSigningAlgs; 380 } 381 382 public void setSupportedIdTokenSigningAlgs(List<String> theSupportedIdTokenSigningAlgs) { 383 mySupportedIdTokenSigningAlgs = theSupportedIdTokenSigningAlgs; 384 } 385 386 public void addSupportedIdTokenSigningAlg(String theAlg) { 387 getSupportedIdTokenSigningAlgs().add(theAlg); 388 } 389 390 public List<String> getCodeChallengeMethodsSupported() { 391 if (myCodeChallengeMethodsSupported == null) { 392 myCodeChallengeMethodsSupported = new ArrayList<>(); 393 } 394 return myCodeChallengeMethodsSupported; 395 } 396 397 public void setCodeChallengeMethodsSupported(List<String> theCodeChallengeMethodsSupported) { 398 myCodeChallengeMethodsSupported = theCodeChallengeMethodsSupported; 399 } 400 401 public void addCodeChallengeMethodSupported(String theCode) { 402 getCodeChallengeMethodsSupported().add(theCode); 403 } 404 405 public List<String> getSubjectTypesSupported() { 406 if (mySubjectTypesSupported == null) { 407 mySubjectTypesSupported = new ArrayList<>(); 408 } 409 return mySubjectTypesSupported; 410 } 411 412 public void setSubjectTypesSupported(List<String> theSubjectTypesSupported) { 413 mySubjectTypesSupported = theSubjectTypesSupported; 414 } 415 416 public void addSubjectTypeSupported(String theType) { 417 getSubjectTypesSupported().add(theType); 418 } 419 420 @JsonAnySetter 421 public void add(String theProp, Object theVal) { 422 myUnknownProperties.put(theProp, theVal); 423 } 424 425 Map<String, Object> getUnknownProperties() { 426 return myUnknownProperties; 427 } 428 429 Map<String, Object> toMap() { 430 Map<String, Object> map = new HashMap<>(); 431 Field[] fields = OpenIdWellKnownOpenIdConfigurationResponseJson.class.getDeclaredFields(); 432 433 try { 434 for (Field field : fields) { 435 if (field.isAnnotationPresent(JsonProperty.class)) { 436 Object value = field.get(this); 437 if (value != null) { 438 // we want the names to be whatever's in the json annotation 439 JsonProperty jsonProperty = field.getAnnotation(JsonProperty.class); 440 String name = jsonProperty.value(); 441 map.put(name, value); 442 } 443 } 444 } 445 } catch (IllegalAccessException ex) { 446 throw new InternalErrorException(ex); 447 } 448 449 map.putAll(myUnknownProperties); 450 451 return map; 452 } 453 454 @Override 455 public String toString() { 456 ObjectMapper mapper = new ObjectMapper(); 457 Map<String, Object> map = toMap(); 458 459 try { 460 return mapper.writeValueAsString(map); 461 } catch (JsonProcessingException ex) { 462 throw new InternalErrorException(ex); 463 } 464 } 465} 466 467@Deprecated(since = "2025.11.R01", forRemoval = true) 468class OpenIdWellKnownOpenIdConfigurationResponse extends OpenIdWellKnownOpenIdConfigurationResponseJson {}