-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify the webApi endpoint #10
Comments
?!?! i think you are a little bit confused: endpoints are the GUID of azure Active Directory web app that host your api. for example if you have 2 api web-endpoint https://myapi1.azurewebsites.net has a GUID 'XXXXXXX......' Here is adalConfig.js import { AuthenticationContext, adalFetch } from 'react-adal';
export const adalConfig = {
tenant: 'AZURE ADAL TENTEN GUID',
clientId: 'AZURE APP CLIENT ID',
endpoints: {
myapi1: 'XXXXXXXXXXXXXXX',
myapi2: 'YYYYYYYYYYYYYYY',
},
cacheLocation: 'localStorage',
};
export const authContext = new AuthenticationContext(adalConfig);
export const adalApi1Fetch = (fetch, url, options) =>
adalFetch(authContext, adalConfig.endpoints.myapi1, fetch, url, options);
export const adalApi2Fetch = (fetch, url, options) =>
adalFetch(authContext, adalConfig.endpoints.myapi2, fetch, url, options); |
Thank you! Your example of made it very clear of how it is being used! |
On adalConfig.js how can we specify an endpoint different from 'api'? (e.g. 'http://localhost:5000/api/')
If I do this:
I get this error on adalApiFetch:
Uncaught (in promise) {message: "resource is required", msg: "resource is required"}
The text was updated successfully, but these errors were encountered: