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']);
}
);
}