I have a simple project that requires the simple following configuration :
- I have a "password" grant_type, which means I can submit the username/password (that the user enters in my login form), and get an access_token on success.
- With that access_token, I can request an API and get the user's information.
I know the URIs of the APIs, I don't want anything huge (I saw the configuration on https://github.com/spring-projects/spring-security-oauth/tree/master/samples) and it seems HUGE.
I can think of it this way :
- Do a simple HTTP request, giving *client_id* , *client_secret* , *grant_type=password* , username and password (that the user provided).
- I receive an *ACCESS_TOKEN* (and some other stuff) in a JSON response.
- I use the *ACCESS_TOKEN* to query a URL (using simple GET request), that will give the user's information.
- I set the information in HttpSession and consider the user as logged in.
It can be done in 2 HTTP requests. I just don't want to do it this way, but using the "safer" way instead with Spring Security OAuth2.
Can you think of what "simple" config I need to make to have this done?