We have to integrate OAuth 2.0 authorization code grant in my client project. Currently, the app uses a native login page. We need to remove the page and redirect non logged-in users to AS login page, https://as.com/as/authorization.oauth2?client_id=UoM&response_type=code
. After successful login at AS end, we are redirected to the configured redirect_uri
. At this point, how will my client application know that the user has logged in at AS? How can I maintain the Session at client end? Also, I need to exchange the auth code with and access token and use it for subsequent server API calls. So how can I achieve that and send the token as header?
The application is written in Angular 4. I've never worked on client projects before, hence the confusion.
I just need brief points/code-snippets on how to do this.