简体   繁体   中英

IdentityServer4 and Angular4

I am building a test with IdentityServer4 to understand how it works, I got the server running but I am trying to use the /connect/token endpoint from Angular 4, so I built the json to send to the post but it doesn't work as json, I get a 400 bad request answer with the invalid request. If I use form-data on postman I get a 200 OK with the token I want to test, so how do I actual send the data for IdentityServer4 from Angular 4 as form-data and not json, I have never done this so it is a bit hard for me to understand how to do it. Thank you for any pointer.

I think the best way to communicate with identity server from any javascript app, including Angular, is to use oidc-client-js . It has all you need login, token refresh and much more . Checkout this sample to see how it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM