Token request for grant type password gives 302 from Angular client
-
When using user credentials grant type, the post request for getting access token from server i.e.
https://example-wordpress.com/oauth/token
works fine for jQuery ajax and Postman. But when the same request is made from Angular 5 HttpClient, instead of access token JSON in response, the server gives 302 redirect and xhr redirect tohttps://example-wordpress.com/login/?redirect_to=https%3A%2F%2Fexample-wordpress.com%2Foauth%2Ftoken
which generates html of login page in response and hence not able to get access token.I’m not able to find the reason behind this behaviour. Why server redirects to login page for access token request from angular and works fine for jQuery ajax request?
- The topic ‘Token request for grant type password gives 302 from Angular client’ is closed to new replies.