react-adal | Azure Active Directory Library support for ReactJS | Azure library
kandi X-RAY | react-adal Summary
kandi X-RAY | react-adal Summary
Azure Active Directory Library (ADAL) support for React.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Wrapper around the adal context
- Utility function to take a resource and return a new one
- Fetches the adal
- Create a Custom Event
- Parse resourceInfo
- Returns whether the new message should be appended to redirects .
react-adal Key Features
react-adal Examples and Code Snippets
Community Discussions
Trending Discussions on react-adal
QUESTION
Hi I am working on implementation of authentication and authorization for my client SPA application and .Net core back end API application. I have registred two application in azure ad for SPA and API app. I am able to get the token using Postman as below.
I am able to get the token with required details. Now I am trying same thing in front end react app. I am using react adal library.
I have below code to get token
...ANSWER
Answered 2021-Mar-22 at 05:43You has a backend api program, so if you need to generate an access token for the api in it, you need to expose that api in azure ad then give api permission to an azure ad app(can be the one exposed api), then you can generate that token.
And I found a sample of using adal with react. And added the acquireToken code like below, as you can see that the scope is graph because here I wanna call the graph api. The same as yours, if you wanna generate the token used to call your own api, you need to change the parameter of acquireToken and change the url in ajax call.
And micrsoft has upgrade to recommend to use msal to replace adal, this sample is helpful.
QUESTION
Hi I have SPA application and .Net core web API. I have registered two applications in azure AD. Below is my adal config in react app.
...ANSWER
Answered 2021-Mar-18 at 08:33Since the access token is for your web API app, you need to specify the scope as api://{client id of the Web API app}/.default
for V2.0.
Then the aud
in access token whill be {client id of the Web API app}
.
You can get the access token in Postman like this:
In my experience, adal is using V1.0 so we don't need to put .default
. You should specify the scope in the adalConfig
like:
QUESTION
i have created react dotnet core webapp and implemented AAD authnetication for front end using "react-adal".But not getting how can i authenticate backend.
Please suggest any approach !
...ANSWER
Answered 2020-Nov-11 at 06:33It is recommended to use MSAL as ADAL is being deprecated.
Also, front end libraries uses implicit and auth code flow which will authenticate in front end itself. So, since you are using front end library it is not possible to auth with back end. For authenticating with BAckend use backend language like asp.net(we can use Msal.net library).
Here is a Sample on how to use MSAL with React to call Microsoft Graph.
The only different in your case will be that instead of calling Microsoft Graph, you will call your own API.
Bottomline is - there is no direct integration package yet for react. Which can also be read from the official statement on the msal-js repo:
After our current libraries are up to standards, we will begin balancing new feature requests, with new platforms such as react and node.js.
If you want to use .net core instead then please go through the sample here
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-adal
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page