I am using Spring OAuth2 to enable login with SoundCloud. I've have already registered my callback url. So when I am using Spring OAuth2 and set my redirect url explicitly it forced me to process it manually (by providing some controller for it).
I put it in application.yml :
pre-established-redirect-uri: https://localhost:8443/callback
use-current-uri: false
and i got 404 with :
https://localhost:8443/callback?code=...
Can I force Spring OAuth2 get access token automatically without handling callback?
A redirect URI, or reply URL, is the location where the authorization server sends the user once the app has been successfully authorized and granted an authorization code or access token.
Deprecated. See the OAuth 2.0 Migration Guide for Spring Security 5. Rest template that is able to make OAuth2-authenticated REST requests with the credentials of the provided resource.
Interface OAuth2AuthorizedClientRepositoryThe primary purpose of an Authorized Client is to associate an Access Token credential to a Client and Resource Owner, who is the Principal that originally granted the authorization.
oauth2Login() provides a number of configuration options for customizing OAuth 2.0 Login. The main configuration options are grouped into their protocol endpoint counterparts. For example, oauth2Login(). authorizationEndpoint() allows configuring the Authorization Endpoint, whereas oauth2Login().
I think you have to handle the callback to get the access token from sound cloud Api. Spring-social is helpful to get the access token without handling callback but that is available only for Facebook, Twitter and LinkedIn for now. You can check this link about spring social :
http://projects.spring.io/spring-social/core.html
Just checked it looks like someone has tried to provide the sound cloud api binding with spring-social. But I doubt it's completeness. You can check this link to get an idea :
https://github.com/michaellavelle/spring-social-soundcloud
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With