Reputation: 67
I have created Oauth2 server following to this spring-security-oauth-example. How can I get the Oauth2 token from Postman ?
This is the code for Resource Server and this is the code for AuthorizationServerConfig.
I want to understand how can I get the Oauth2 token for clientid = "ClientId" from Postman ? And what these below code signify:
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
@Autowired
private AuthenticationManager authenticationManager;
@Override
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
security.tokenKeyAccess("permitAll()")
.checkTokenAccess("isAuthenticated()");
}
public class ResourceServerConfig extends WebSecurityConfigurerAdapter {
http.requestMatchers()
.antMatchers("/login", "/oauth/authorize") //what does this do
application.properties has
server.port=8081
server.context-path=/auth security.basic.enable=false
Upvotes: 1
Views: 9646
Reputation: 16469
The steps to set up the OAuth 2.0 token in Postman.
Open Postman.
Create a new request. Click on "authorization" tab. Screenshot below :
Type
of authentication as OAuth 2.0. Screenshot below :So, I'm adding some helpful resources for you to understand the OAuth 2.0 Type.
A screenshot from the above link : How the Oauth 2.0 Authorization Framework looks like.
Some video lectures to understand it visually :
Upvotes: 4