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

WebAPI intergration scenario #2

Open
sonphnt opened this issue May 10, 2017 · 7 comments
Open

WebAPI intergration scenario #2

sonphnt opened this issue May 10, 2017 · 7 comments

Comments

@sonphnt
Copy link

sonphnt commented May 10, 2017

Hi @damienbod

Thanks for a great contribution.
Do you think we can add a web api core project here?
The flow is:

MVC Angular will be redirected to IdentityServer login page. After successful login there, you will be navigated back to MVC angular.

Angular app need to interact with WebApi to do CRUD function on data.
How can we get a valid access token from MVC, so Angular can pass it to Webapi?

Thanks

@damienbod
Copy link
Owner

damienbod commented May 13, 2017

A valid access token is returned in the cookie. You could change the flow or the middleware if you want to use the cookie directly, or you could just use the cookie.

Greetings Damien

@sonphnt
Copy link
Author

sonphnt commented May 15, 2017

Hi @damienbod

Is there any code showing the way get access token in cookies in Angular. And do we need any configuration between Angular and Webapi ?

Thanks

@johnsonps08
Copy link

@damienbod, it would be really appreciated if you could answer the above question from @sonphnt.

@damienbod
Copy link
Owner

@johnsonps08 @sonphnt , sorry missed this. No the cookie is http only. If you require an access_token to access an API from a different server, you could use a different flow, or access the API from the server. I will look into this. I will check if access_token can be made public to the client, to access the API

@damienbod
Copy link
Owner

think this is possible using the connect/token API, will investigate

@sonphnt
Copy link
Author

sonphnt commented Jun 12, 2017

Yes, something as we have 3 servers Angular-Webapi-IdentityServer. Firstly, Angular will be redirected to IdentityServer back and forth to authenticate first. WebAPI talk to IdentityServer in background somehow. And then Angular will request to WebApi to retrieve data after being authenticated at step 1.

That would be nice if we could have a project setup for this scenario.

@ncalarco
Copy link

@damienbod were you ever able to investigate whether or not we can make a call out to the connect/token API?

Thank you!

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

4 participants