如何使用身份验证从我的ASP.NET核心站点认证angular 2网络应用程序? [英] How to use authentication from my ASP.NET Core site to authenticate angular 2 web app?

查看:240
本文介绍了如何使用身份验证从我的ASP.NET核心站点认证angular 2网络应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有ASP.NET Core应用程序与角2前端。我使用cookie auth。
但是我想把我的应用程序分成两个独立的网站 - 一个前端网站在angular2和一个后端网站在asp.net核心。

I have ASP.NET Core app with angular 2 front-end. I use cookie auth. But I want to split my app into 2 separate sites - one front-end site on angular2 and one back-end site on asp.net core.

如何使用auth从ASP.NET核心站点验证前端应用程序?
我的后端网站有一个登录页面。如何在前端应用程序中识别我未经身份验证,然后重定向到后端应用程序,然后获取身份验证Cookie?我不知道我理解这个过程的机制。

How do I use auth from ASP.NET Core site to authenticate front-end app? There's a login page in my back-end site. How do I identify in front-end app that I'm not authenticated, then redirect to back-end app and then get auth cookies? I'm not sure I understand mechanic of this process.

推荐答案

我使用基于令牌的身份验证。我选择了此解决方案: https://stormpath.com/blog/token-authentication- asp-net-core & https://github.com/nbarbettini/SimpleTokenProvider

I used token based authentication. I choosed this solution: https://stormpath.com/blog/token-authentication-asp-net-core & https://github.com/nbarbettini/SimpleTokenProvider

这篇关于如何使用身份验证从我的ASP.NET核心站点认证angular 2网络应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆