Polish gh-4557

This commit is contained in:
Joe Grandja
2020-02-11 04:20:59 -05:00
parent 71a5c9521c
commit ff8002eb2e
27 changed files with 618 additions and 932 deletions

View File

@@ -29,25 +29,25 @@
<oauth2-login access-token-response-client-ref="accessTokenResponseClient"
user-service-ref="oauth2UserService"
authorization-request-repository-ref="authorizationRequestRepository"
authentication-success-handler-ref="authenticationSuccessHandler"
authentication-failure-handler-ref="testHandler"/>
authentication-success-handler-ref="authenticationSuccessHandler"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationSuccessListener" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.context.ApplicationListener"/>
</b:bean>
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationSuccessHandler"/>
</b:bean>
<b:bean id="testHandler" class="org.springframework.security.config.http.OAuth2LoginBeanDefinitionParserTests.TeapotAuthenticationHandler"/>
<b:import resource="../oauth2/client/google-registration.xml"/>
<b:import resource="../oauth2/client/google-github-registration.xml"/>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -28,31 +28,31 @@
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login access-token-response-client-ref="accessTokenResponseClient"
user-service-ref="oauth2UserService"
user-authorities-mapper-ref="grantedAuthoritiesMapper"
user-authorities-mapper-ref="userAuthoritiesMapper"
jwt-decoder-factory-ref="jwtDecoderFactory"
authorization-request-repository-ref="authorizationRequestRepository"
authentication-success-handler-ref="authenticationSuccessHandler"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="grantedAuthoritiesMapper" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="userAuthoritiesMapper" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationSuccessHandler"/>
</b:bean>
<b:bean name="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoderFactory"/>
</b:bean>
<b:import resource="../oauth2/client/google-registration.xml"/>
<b:import resource="../oauth2/client/google-github-registration.xml"/>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -32,20 +32,20 @@
authorization-request-repository-ref="authorizationRequestRepository"
authentication-success-handler-ref="authenticationSuccessHandler" />
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationSuccessHandler"/>
</b:bean>
<b:import resource="../oauth2/client/google-registration.xml"/>
<b:import resource="../oauth2/client/google-github-registration.xml"/>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -29,7 +29,7 @@
<oauth2-login authentication-failure-handler-ref="authenticationFailureHandler"/>
</http>
<b:bean name="authenticationFailureHandler" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationFailureHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationFailureHandler"/>
</b:bean>

View File

@@ -26,10 +26,10 @@
<http auto-config="true">
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login authorization-request-resolver-ref="oauth2AuthorizationRequestResolver"/>
<oauth2-login authorization-request-resolver-ref="authorizationRequestResolver"/>
</http>
<b:bean name="oauth2AuthorizationRequestResolver" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestResolver" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver"/>
</b:bean>

View File

@@ -28,24 +28,24 @@
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login access-token-response-client-ref="accessTokenResponseClient"
jwt-decoder-factory-ref="jwtDecoderFactory"
user-authorities-mapper-ref="grantedAuthoritiesMapper"
user-authorities-mapper-ref="userAuthoritiesMapper"
authorization-request-repository-ref="authorizationRequestRepository"
authentication-success-handler-ref="authenticationSuccessHandler"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoderFactory"/>
</b:bean>
<b:bean name="grantedAuthoritiesMapper" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="userAuthoritiesMapper" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationSuccessHandler"/>
</b:bean>

View File

@@ -28,23 +28,22 @@
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login access-token-response-client-ref="accessTokenResponseClient"
jwt-decoder-factory-ref="jwtDecoderFactory"
user-authorities-mapper-ref="grantedAuthoritiesMapper"
authorization-request-repository-ref="authorizationRequestRepository"
/>
authorization-request-repository-ref="authorizationRequestRepository"/>
<request-cache ref="requestCache" />
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoderFactory"/>
</b:bean>
<b:bean name="grantedAuthoritiesMapper" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean id="requestCache" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.savedrequest.RequestCache"/>
</b:bean>
<b:import resource="../oauth2/client/google-registration.xml"/>
<b:import resource="userservice.xml"/>

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2002-2020 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http auto-config="true">
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login access-token-response-client-ref="accessTokenResponseClient"
user-service-ref="oauth2UserService"
oidc-user-service-ref="oauth2UserService"
authorization-request-repository-ref="authorizationRequestRepository"
authentication-success-handler-ref="authenticationSuccessHandler"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="jwtDecoderFactory" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoderFactory"/>
</b:bean>
<b:bean name="authenticationSuccessListener" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.context.ApplicationListener"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="authenticationSuccessHandler" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.authentication.AuthenticationSuccessHandler"/>
</b:bean>
<b:import resource="../oauth2/client/google-registration.xml"/>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2002-2020 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http auto-config="true">
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login/>
</http>
<client-registrations>
<client-registration registration-id="google-login"
client-id="google-client-id"
client-secret="google-client-secret"
client-authentication-method="basic"
authorization-grant-type="authorization_code"
redirect-uri="{baseUrl}/login/oauth2/code/{registrationId}"
scope="openid,profile,email"
client-name="Google"
provider-id="google"/>
<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"/>
</client-registrations>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -27,8 +27,31 @@
<http auto-config="true">
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login/>
<request-cache ref="requestCache" />
</http>
<b:import resource="../oauth2/client/google-registration.xml"/>
<client-registrations>
<client-registration registration-id="google-login"
client-id="google-client-id"
client-secret="google-client-secret"
client-authentication-method="basic"
authorization-grant-type="authorization_code"
redirect-uri="{baseUrl}/login/oauth2/code/{registrationId}"
scope="openid,profile,email"
client-name="Google"
provider-id="google"/>
<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"/>
</client-registrations>
<b:bean id="requestCache" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.web.savedrequest.RequestCache"/>
</b:bean>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2002-2020 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http auto-config="true">
<intercept-url pattern="/**" access="authenticated"/>
<oauth2-login client-registration-repository-ref="clientRegistrationRepository"
access-token-response-client-ref="accessTokenResponseClient"
user-service-ref="oauth2UserService"
authorization-request-repository-ref="authorizationRequestRepository"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -33,19 +33,19 @@
authorization-request-repository-ref="authorizationRequestRepository"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository"/>
</b:bean>
<b:bean name="authorizedClientRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizedClientRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository"/>
</b:bean>

View File

@@ -33,19 +33,19 @@
authorized-client-service-ref="authorizedClientService"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository"/>
</b:bean>
<b:bean name="authorizedClientService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizedClientService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.OAuth2AuthorizedClientService"/>
</b:bean>

View File

@@ -32,19 +32,18 @@
authorization-request-repository-ref="authorizationRequestRepository"/>
</http>
<b:bean name="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="accessTokenResponseClient" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient"/>
</b:bean>
<b:bean name="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="oauth2UserService" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.userinfo.OAuth2UserService"/>
</b:bean>
<b:bean name="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="authorizationRequestRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.web.AuthorizationRequestRepository"/>
</b:bean>
<b:bean name="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:bean id="clientRegistrationRepository" class="org.mockito.Mockito" factory-method="mock">
<b:constructor-arg value="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository"/>
</b:bean>
<b:import resource="userservice.xml"/>
</b:beans>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2002-2020 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<client-registrations>
<client-registration registration-id="google-login"
client-id="google-client-id"
client-secret="google-client-secret"
client-authentication-method="basic"
authorization-grant-type="authorization_code"
redirect-uri="{baseUrl}/login/oauth2/code/{registrationId}"
scope="openid,profile,email"
client-name="Google"
provider-id="google"/>
<provider provider-id="google"
issuer-uri="http://localhost:49259"/>
</client-registrations>
</b:beans>

View File

@@ -39,7 +39,7 @@
client-authentication-method="basic"
authorization-grant-type="authorization_code"
redirect-uri="{baseUrl}/login/oauth2/code/{registrationId}"
scope="openid,profile,email"
scope="read:user"
client-name="Github"
provider-id="github"/>
<provider provider-id="google"