MSAL auth with web app and backend service

Varun Natraaj 1 Reputation point
2021-04-13T08:10:50.577+00:00

Hello,

We are in the process of building an application which has a Vue JS based web app that is powered by a Ruby on Rails backend. We have been looking into setting up oauth based sign up/sign in experiences and we have hit a little bit of a roadblock with MSAL 2.0 flows.

With other services, we're able to do this as a two step process:

  1. Users click sign in on the front-end. They're taken to the authorization URL, choose the account, grant permissions. This steps sends back the auth code to the front end app.
  2. The front-end app is then able to hit the callback URL in the back-end app (RoR) with the auth code which in turns gets the access tokens, refresh tokens, etc since it has the client secret with it.

So in this way, we're able to let users sign in with a provider, and are also able to store the tokens for access provider APIs for other integrations such as calendar, mail, etc.

Is there any way to do this with the MSAL 2.0 auth code flow because from what we've been seeing in the docs and trying, we are able to get the token directly in either front-end or back-end but not the hybrid flow that we've. Is there any way to go about doing this and do you have any suggestions?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,622 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VipulSparsh-MSFT 16,231 Reputation points Microsoft Employee
    2021-05-13T14:30:44.057+00:00

    @Varun Natraaj Thanks for reaching out and apologies for delay on this.

    Let us know if following link helps you with your scenario
    https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-nodejs-console

    If you are still facing the problem, do let us know so that we can proceed accordingly.

    -----------------------------------------------------------------------------------------------------------------

    If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.

    0 comments No comments