When I use the demo-authorizationserver, messages-resource, and demo-client in the spring authorization server samples, I want to use ajax to get userlist in the demo-client. The demo-client reports an error。
Access to XMLHttpRequest at ‘http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=message.read%20message.write&state=8U7X77oupXyeCXBv-0jKyATz_H3UJxdjCxHGIjv8A80%3D&redirect_uri=http://127.0.0.1:8080/authorized’ (redirected from ‘http://127.0.0.1:8080/user/list’) from origin ‘http://127.0.0.1:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.
GET http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=message.read%20message.write&state=8U7X77oupXyeCXBv-0jKyATz_H3UJxdjCxHGIjv8A80%3D&redirect_uri=http://127.0.0.1:8080/authorized net::ERR_FAILED
I have not made any changes to demo-authorizationserver, message-resource, and demo-client. I want to use ajax to get data in demo-client. How should I do it?
Amrnyang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.