on 2018 Apr 15 5:01 AM
Hi,
I need to implement/configure OAuth2.0 in the storefront extension. I have updated the storefront's spring-security-config.xml with below configurations for OAuth2.0:
<bean id="userApprovalHandler" class="com.xxx.storefront.oauth2.MyUserApprovalHandler">
<property name="autoApproveClients">
<set>
<value>sampleclientid</value>
</set>
</property>
</bean>
<oauth:authorization-server client-details-service-ref="clientDetails" user-approval-handler-ref="userApprovalHandler" authorization-endpoint-url="/oauth/authorize">
<oauth:authorization-code/>
<oauth:implicit />
<oauth:refresh-token />
<oauth:client-credentials />
<oauth:password />
</oauth:authorization-server>
<oauth:client-details-service id="clientDetails">
<oauth:client client-id="sampleclientid" resource-ids="sampleresourceid" scope="extended"
authorized-grant-types="authorization_code,refresh_token,password,client_credentials"
authorities="ROLE_TRUSTED_CLIENT,ROLE_CLIENT"
secret="samplesecret" autoapprove="true" />
</oauth:client-details-service>
The problem is that the /oauth/authorize controller method in org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint.java class is not invoked as the DefaultPageController is invoked after successful authentication which treated the call to /oauth/authorize URL as page not found.
Please help how to resolve this issue. Thank you in advance for your help.
Request clarification before answering.
Auth server is there, but DefaultPageController is executed first. Check the logic of DispatcherServlet - it has a list of mapping types , and mapping for DefaultPageController is found before it can find the mappings for auth server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.