我有一个用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处理令牌,任何想法都是捕获这些值的最佳方法吗?谢谢