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

Get token error with http when using httpclient #7

Open
chigivigi opened this issue Jan 23, 2018 · 4 comments
Open

Get token error with http when using httpclient #7

chigivigi opened this issue Jan 23, 2018 · 4 comments

Comments

@chigivigi
Copy link

I am working in a single page application in which i trying to get token from my backend application. I have followed the example on this site https://github.com/benbaran/adal-angular4-example to initialize the authentication. Immediately after the application is authorized I am calling my service to acquire token for my backend application but I receive the error for my service:

[AuthService -> Http]: NullInjectorError: No provider for Http!

In the service I call a method that calls Adal5Service acquireToken method. Is there a way to call the acquire token method without triggering the error ?

I am working in angular version 5.20.

I am using HttpClient instead of Http when providing AdalAngular5 but it still returns the error mentioned above. Also can you set cache location to local storage in adal config ?

@jjjaniszewski
Copy link

I don't know if it helps but for me updating code with this PR (benbaran#23) works fine.

@chigivigi
Copy link
Author

chigivigi commented Jan 30, 2018

I have seen not replaced all my http imports correctly, now that error is no longer shown but I have run into another error that says that the class Adal5Interceptor incorrectly implements interface HttpInterceptor.

@grumar
Copy link
Owner

grumar commented Mar 20, 2018

README updated

grumar added a commit that referenced this issue Mar 20, 2018
@grumar
Copy link
Owner

grumar commented Mar 23, 2018

published as beta
npm install [email protected]

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

3 participants