Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Ouath2 Registered Redirect Uri

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?

like image 350
Sergii Getman Avatar asked Jan 04 '17 14:01

Sergii Getman


People also ask

What is redirect URI in OAuth2?

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.

Is OAuth2RestTemplate deprecated?

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.

What is OAuth2AuthorizedClientRepository?

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.

What is oauth2Login?

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().


1 Answers

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

like image 151
Pushpendra Pal Avatar answered Oct 11 '22 00:10

Pushpendra Pal