Closed d3minem closed 4 years ago
Hi @d3minem,
When you request the employee resource, you need not pass in the _granttype or _responsetype. That information is required at the first step when we need to get the token from the Authorization Server, as you were correctly able to get.
To perform a GET on the resource, you need to do this:
curl --request GET 'http://localhost:9081/spring-legacy-oauth-server/employee/{emp_email}
--header ‘Accept: application/json;charset=UTF-8' \
--header 'Authorization: Bearer <your token>’
Hope this helps.
Hi @sampada07
Thanks for letting me know about this. That's right, this information should be shared on the first step which basically gives the access token.
Thanks, Ad.
Glad to be of help!
Issue 71 - Note sure, if it's the same issue but I'm having the problem with both
password
andclient_credentials
grant types.Authorisation Server - Legacy
I'm using postman, and according to above grant types flow - I made the request for access token using
oauth/token
. Please see the burl below:By using the above curl, I was able to get the access token for both grant types.
Grant Type: Password
Grant Type: Client_Credentials
Now the problem, when I'm trying to access
/employee
resource using the admin useradmin/nimda
or simple userjohn/123
with above retrieved access token. It always redirect to me the login page.Request For Employee Resource:
Output: Always redirect to the login page with success code
200
.Sticky Sessions:
I have another question - Why do we have sticky sessions? and how can we disable on authorization server. Do we really need it for
REST
apis? I believeJwT
oraccess_token
management is the responsibility of thin clients to send along with each request (web or mobile).or
I always see
--header 'Cookie: JSESSIONID=F058C04FB269BFA091CF6941C278DFEE'
when I request for resource and it redirect to login page. However, foroauth/token
sticky sessions are disabled from the server side and don't see that cookie has been set by server in the postman client.