the-a-train
the-a-train

Reputation: 1143

azure AD and graph access - angular front end and laravel php backend

I have an angular front end and laravel api backend and I want to allow users from my internal app to login using their microsoft details but I also want to use the laravel authentication functionality as well.

Should i be able to install the msal javascript library on my angular app, have the user go through the popup or redirect flow to get an access token, pass that token to my api and then the api can query the azure/graph api's using that token?

Upvotes: 1

Views: 1836

Answers (1)

Luke Duda
Luke Duda

Reputation: 934

You should create the authentication functionality through laravel backend.

Msal javascript library is only for the Single Page Applications.

You can read about authentication flows with tutorials and code samples in MS docs: https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-overview

Besides that, Laravel has two packages for Azure AD authentications: https://github.com/metrogistics/laravel-azure-ad-oauth - Extension of Socialite https://github.com/rootinc/laravel-azure-middleware - Based on middleware

There is a lot of information about how to work with MS Azure AD authentication on the https://laracasts.com/

Upvotes: 3

Related Questions