Reputation: 35
I've never implemented an application that needed to handle user authentication and authorization.
Now I'm trying to implement an app that has a front-end build with angular and a back-end build with spring security. And I want to user Wso2 identity server as an identity provider.
My doubt is, should i use a library like angular-oauth2-oidc or Asgardeo in the front-end and call the endpoint for the identity server authorization server from here; or should I call an api that I should implement in the backend and that api calls the identity server authorization server endpoint and returns to the front-end the access token generated?
Upvotes: 0
Views: 340
Reputation: 12754
Use an OIDC client lib for Angular. My favorite is angular-auth-oidc-client. It will handle:
It also provides with Angular route guard to redirect to login when an unauthorized user tries to activate a protected route.
Upvotes: 0