Skip to content
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

Question: using adalApiFetch with an api? #3

Closed
missgrizzly opened this issue Dec 13, 2017 · 4 comments
Closed

Question: using adalApiFetch with an api? #3

missgrizzly opened this issue Dec 13, 2017 · 4 comments

Comments

@missgrizzly
Copy link

I was wondering if you could elaborate on this part of the readme?

use adalApiFetch with your favorite "fetch" in your api call.

Like with a sample? Specifically with an api behind it would be amazingly helpful

@saostad
Copy link

saostad commented Dec 26, 2017

+1

1 similar comment
@uros-r
Copy link

uros-r commented Jan 7, 2018

+1

@andrralv
Copy link

andrralv commented Jan 11, 2018

export function adalFetch(authContext, resourceGuiId, fetch, url, options) {

The adalFetch function takes a fetch object, you can choose to use any npm package like Node-fetch or Axios and pass it on.

@salvoravida
Copy link
Owner

without ADAL you will fetch normally:

import fetch from 'isomorphic-fetch';
const myApiCall = () => fetch("www.domain.com/api/myapi", options)

if your domain is under ADAL then ..

import fetch from 'isomorphic-fetch';
import { adalApiFetch } from './adalConfig';
const myApiCall = () => adalApiFetch(fetch,"www.domain.com/api/myapi", options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants