I did an SPA that gets an access token from Azure, and an API with which I need to securely communicate. My users are Azure ones so I followed these Microsoft instructions to register the API and the related scopes.
Custom Custom
SPA AzureAD API Graph
──┼───────────┼───────────┼───────────┼──
│ │ │ │
Access │ ────────> │ │ │
Token │ <──────── │ │ │
│ │ │ │
Access some │ ────────────────────> │ │
resource │ │ │ │
│ │ │ │
Check the │ │ <──────── │ │
token │ │ ────────> │ │ ╮ Both things
│ │ │ │ │ I need to do
Get info │ │ │ ────────> │ ╯ with Symfony
about the user │ │ <──────── │
│ │ │ │
Return the │ <──────────────────── │ │
resource │ │ │ │
Now I need to validate the token from the API with php (Symfony 4) and eventually get some info about the user with Graph on behalf of him.
I guess there are plenty of Symfony bundles there to help me do that, I'd like to avoid reinventing the wheel and I guess I should use the "On Behalf Of" flow, am I right ?
So my question is: Can someone point me to some known bundles and some examples ? Should I do an authenticator guard ?