小编Van*_*Web的帖子

使用oauth2和AngularJS在Web API中向令牌发送附加参数

我有一个用AngularJS编写的应用程序,通过oauth 2联系Web API进行身份验证.所有内容都适用于该核心部分,但我需要传入其他参数来评估登录(clientID)并设置记住我的类型功能(记住).

从Angular方面来看,它看起来像这样:

    var data = "grant_type=password&username=" + form.username + "&password=" + form.password + "&clientID=" + clientID + "&remember=" + form.remember;

    var deferred = $q.defer();

    $http.post(serviceBase + 'token', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).success(function (response) {
Run Code Online (Sandbox Code Playgroud)

一旦我通过Startup.cs和SimpleAuthorizationServerProvider.cs处理令牌,任何想法都是捕获这些值的最佳方法吗?谢谢

c# oauth-2.0 asp.net-web-api angularjs

7
推荐指数
1
解决办法
5334
查看次数

标签 统计

angularjs ×1

asp.net-web-api ×1

c# ×1

oauth-2.0 ×1