0
认证I'using角4 + ASP MVC 5 WEB API,我已经集成令牌认证 code from here,我可以使用POST海报获得令牌http://localhost:3590/TokenASP网5网页API令牌角4
如何在Angular 4中使用这种认证? 谢谢
认证I'using角4 + ASP MVC 5 WEB API,我已经集成令牌认证 code from here,我可以使用POST海报获得令牌http://localhost:3590/TokenASP网5网页API令牌角4
如何在Angular 4中使用这种认证? 谢谢
这是我的代码,替换你的用户名,密码和端口号。您可以在会话存储中检查令牌。
Login():void{
const body='[email protected]&password=Zx123.&grant_type=password';
let resp=this.http.post('http://localhost:11694/token',body,
{observe:'response'}).subscribe(res=>{
sessionStorage.setItem('myToken',res.body['access_token']);
}
);
}