0

I'm using this example( https://github.com/microsoftgraph/msgraph-training-angularspa ) and it is working fine by showing my calendar. But i need your help to get the oauth2 code.Then I will register this code in my database so i can use it to get my access token,refresh token and Id token in my personal application. PS : I already have done this with Google Calendar API but it seems more complicated with Outlook Calendar API.

Kha15
  • 51
  • 1
  • 1
  • 6

1 Answers1

0

You'd better use implicit flow for Angular app .The Microsoft identity platform enables single page applications to sign in users, and get tokens to access back-end services or web APIs, by using the implicit grant flow. The implicit flow allows the application to get ID tokens to represent the authenticated user, and also access tokens needed to call protected APIs.

Compare to OAuth 2.0 authorization code flow , the big difference is implicit flow doesn't need to perform a backend server credential exchange , with code flow a backend server should provide client id/secret to acquiring token with code .

You can click here for document & code samples which shows how to use MSAL Angular library to authenticate user and acquire token for accessing APIs.

Nan Yu
  • 26,101
  • 9
  • 68
  • 148