Polish client-registration xsd attributes

Issue gh-4557
This commit is contained in:
Joe Grandja 2020-03-02 14:13:59 -05:00
parent e97396b9c7
commit c111099640
7 changed files with 47 additions and 47 deletions

View File

@ -57,10 +57,10 @@ public final class ClientRegistrationsBeanDefinitionParser implements BeanDefini
private static final String ATT_PROVIDER_ID = "provider-id";
private static final String ATT_AUTHORIZATION_URI = "authorization-uri";
private static final String ATT_TOKEN_URI = "token-uri";
private static final String ATT_USERINFO_URI = "userinfo-uri";
private static final String ATT_USERINFO_AUTHENTICATION_METHOD = "userinfo-authentication-method";
private static final String ATT_USERNAME_ATTRIBUTE_NAME = "username-attribute-name";
private static final String ATT_JWKSET_URI = "jwkset-uri";
private static final String ATT_USER_INFO_URI = "user-info-uri";
private static final String ATT_USER_INFO_AUTHENTICATION_METHOD = "user-info-authentication-method";
private static final String ATT_USER_INFO_USER_NAME_ATTRIBUTE = "user-info-user-name-attribute";
private static final String ATT_JWK_SET_URI = "jwk-set-uri";
private static final String ATT_ISSUER_URI = "issuer-uri";
@Override
@ -138,14 +138,14 @@ public final class ClientRegistrationsBeanDefinitionParser implements BeanDefini
.ifPresent(value -> provider.put(ATT_AUTHORIZATION_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_TOKEN_URI))
.ifPresent(value -> provider.put(ATT_TOKEN_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USERINFO_URI))
.ifPresent(value -> provider.put(ATT_USERINFO_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USERINFO_AUTHENTICATION_METHOD))
.ifPresent(value -> provider.put(ATT_USERINFO_AUTHENTICATION_METHOD, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USERNAME_ATTRIBUTE_NAME))
.ifPresent(value -> provider.put(ATT_USERNAME_ATTRIBUTE_NAME, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_JWKSET_URI))
.ifPresent(value -> provider.put(ATT_JWKSET_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USER_INFO_URI))
.ifPresent(value -> provider.put(ATT_USER_INFO_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USER_INFO_AUTHENTICATION_METHOD))
.ifPresent(value -> provider.put(ATT_USER_INFO_AUTHENTICATION_METHOD, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_USER_INFO_USER_NAME_ATTRIBUTE))
.ifPresent(value -> provider.put(ATT_USER_INFO_USER_NAME_ATTRIBUTE, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_JWK_SET_URI))
.ifPresent(value -> provider.put(ATT_JWK_SET_URI, value));
getOptionalIfNotEmpty(providerElt.getAttribute(ATT_ISSUER_URI))
.ifPresent(value -> provider.put(ATT_ISSUER_URI, value));
providers.put(providerId, provider);
@ -190,14 +190,14 @@ public final class ClientRegistrationsBeanDefinitionParser implements BeanDefini
.ifPresent(builder::authorizationUri);
getOptionalIfNotEmpty(provider.get(ATT_TOKEN_URI))
.ifPresent(builder::tokenUri);
getOptionalIfNotEmpty(provider.get(ATT_USERINFO_URI))
getOptionalIfNotEmpty(provider.get(ATT_USER_INFO_URI))
.ifPresent(builder::userInfoUri);
getOptionalIfNotEmpty(provider.get(ATT_USERINFO_AUTHENTICATION_METHOD))
getOptionalIfNotEmpty(provider.get(ATT_USER_INFO_AUTHENTICATION_METHOD))
.map(AuthenticationMethod::new)
.ifPresent(builder::userInfoAuthenticationMethod);
getOptionalIfNotEmpty(provider.get(ATT_JWKSET_URI))
getOptionalIfNotEmpty(provider.get(ATT_JWK_SET_URI))
.ifPresent(builder::jwkSetUri);
getOptionalIfNotEmpty(provider.get(ATT_USERNAME_ATTRIBUTE_NAME))
getOptionalIfNotEmpty(provider.get(ATT_USER_INFO_USER_NAME_ATTRIBUTE))
.ifPresent(builder::userNameAttributeName);
return builder;
}

View File

@ -558,16 +558,16 @@ provider.attlist &=
attribute token-uri {xsd:token}?
provider.attlist &=
## The UserInfo Endpoint URI used to access the claims/attributes of the authenticated end-user.
attribute userinfo-uri {xsd:token}?
attribute user-info-uri {xsd:token}?
provider.attlist &=
## The authentication method used when sending the access token to the UserInfo Endpoint. The supported values are header, form and query.
attribute userinfo-authentication-method {"header" | "form" | "query"}?
attribute user-info-authentication-method {"header" | "form" | "query"}?
provider.attlist &=
## The name of the attribute returned in the UserInfo Response that references the Name or Identifier of the end-user.
attribute username-attribute-name {xsd:token}?
attribute user-info-user-name-attribute {xsd:token}?
provider.attlist &=
## The URI used to retrieve the JSON Web Key (JWK) Set from the Authorization Server, which contains the cryptographic key(s) used to verify the JSON Web Signature (JWS) of the ID Token and optionally the UserInfo Response.
attribute jwkset-uri {xsd:token}?
attribute jwk-set-uri {xsd:token}?
provider.attlist &=
## The URI used to discover the configuration information for an OAuth 2.0 or OpenID Connect 1.0 Provider.
attribute issuer-uri {xsd:token}?

View File

@ -1737,14 +1737,14 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="userinfo-uri" type="xs:token">
<xs:attribute name="user-info-uri" type="xs:token">
<xs:annotation>
<xs:documentation>The UserInfo Endpoint URI used to access the claims/attributes of the authenticated
end-user.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="userinfo-authentication-method">
<xs:attribute name="user-info-authentication-method">
<xs:annotation>
<xs:documentation>The authentication method used when sending the access token to the UserInfo Endpoint. The
supported values are header, form and query.
@ -1758,14 +1758,14 @@
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="username-attribute-name" type="xs:token">
<xs:attribute name="user-info-user-name-attribute" type="xs:token">
<xs:annotation>
<xs:documentation>The name of the attribute returned in the UserInfo Response that references the Name or
Identifier of the end-user.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="jwkset-uri" type="xs:token">
<xs:attribute name="jwk-set-uri" type="xs:token">
<xs:annotation>
<xs:documentation>The URI used to retrieve the JSON Web Key (JWK) Set from the Authorization Server, which
contains the cryptographic key(s) used to verify the JSON Web Signature (JWS) of the ID

View File

@ -43,10 +43,10 @@
<provider provider-id="google"
authorization-uri="https://accounts.google.com/o/oauth2/v2/auth"
token-uri="https://www.googleapis.com/oauth2/v4/token"
userinfo-uri="https://www.googleapis.com/oauth2/v3/userinfo"
userinfo-authentication-method="header"
username-attribute-name="sub"
jwkset-uri="https://www.googleapis.com/oauth2/v3/certs"/>
user-info-uri="https://www.googleapis.com/oauth2/v3/userinfo"
user-info-authentication-method="header"
user-info-user-name-attribute="sub"
jwk-set-uri="https://www.googleapis.com/oauth2/v3/certs"/>
</client-registrations>
<b:bean id="requestCache" class="org.mockito.Mockito" factory-method="mock">

View File

@ -45,15 +45,15 @@
<provider provider-id="google"
authorization-uri="https://accounts.google.com/o/oauth2/v2/auth"
token-uri="https://www.googleapis.com/oauth2/v4/token"
userinfo-uri="https://www.googleapis.com/oauth2/v3/userinfo"
userinfo-authentication-method="header"
username-attribute-name="sub"
jwkset-uri="https://www.googleapis.com/oauth2/v3/certs"/>
user-info-uri="https://www.googleapis.com/oauth2/v3/userinfo"
user-info-authentication-method="header"
user-info-user-name-attribute="sub"
jwk-set-uri="https://www.googleapis.com/oauth2/v3/certs"/>
<provider provider-id="github"
authorization-uri="https://github.com/login/oauth/authorize"
token-uri="https://github.com/login/oauth/access_token"
userinfo-uri="https://api.github.com/user"
userinfo-authentication-method="header"
username-attribute-name="id"/>
user-info-uri="https://api.github.com/user"
user-info-authentication-method="header"
user-info-user-name-attribute="id"/>
</client-registrations>
</b:beans>

View File

@ -36,9 +36,9 @@
<provider provider-id="google"
authorization-uri="https://accounts.google.com/o/oauth2/v2/auth"
token-uri="https://www.googleapis.com/oauth2/v4/token"
userinfo-uri="https://www.googleapis.com/oauth2/v3/userinfo"
userinfo-authentication-method="header"
username-attribute-name="sub"
jwkset-uri="https://www.googleapis.com/oauth2/v3/certs"/>
user-info-uri="https://www.googleapis.com/oauth2/v3/userinfo"
user-info-authentication-method="header"
user-info-user-name-attribute="sub"
jwk-set-uri="https://www.googleapis.com/oauth2/v3/certs"/>
</client-registrations>
</b:beans>

View File

@ -1136,24 +1136,24 @@ The Authorization Endpoint URI for the Authorization Server.
The Token Endpoint URI for the Authorization Server.
[[nsa-provider-userinfo-uri]]
* **userinfo-uri**
[[nsa-provider-user-info-uri]]
* **user-info-uri**
The UserInfo Endpoint URI used to access the claims/attributes of the authenticated end-user.
[[nsa-provider-userinfo-authentication-method]]
* **userinfo-authentication-method**
[[nsa-provider-user-info-authentication-method]]
* **user-info-authentication-method**
The authentication method used when sending the access token to the UserInfo Endpoint.
The supported values are *header*, *form* and *query*.
[[nsa-provider-username-attribute-name]]
* **username-attribute-name**
[[nsa-provider-user-info-user-name-attribute]]
* **user-info-user-name-attribute**
The name of the attribute returned in the UserInfo Response that references the Name or Identifier of the end-user.
[[nsa-provider-jwkset-uri]]
* **jwkset-uri**
[[nsa-provider-jwk-set-uri]]
* **jwk-set-uri**
The URI used to retrieve the https://tools.ietf.org/html/rfc7517[JSON Web Key (JWK)] Set from the Authorization Server, which contains the cryptographic key(s) used to verify the https://tools.ietf.org/html/rfc7515[JSON Web Signature (JWS)] of the ID Token and optionally the UserInfo Response.