Oauth2 changes to support accessCode flow
Additional logic to support accessCode flow type, as well as minor bug fixes to support the 2.0 spec.
This commit is contained in:
@@ -1777,13 +1777,32 @@ SwaggerAuthorizations.prototype.apply = function (obj, authorizations) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (name in authorizations) {
|
||||
for (key in this.authz) {
|
||||
if (key == name) {
|
||||
value = this.authz[key];
|
||||
result = value.apply(obj, authorizations);
|
||||
if (result === true)
|
||||
status = true;
|
||||
// 2.0 support
|
||||
if (Array.isArray(authorizations)) {
|
||||
for (var i = 0; i < authorizations.length; i++) {
|
||||
var auth = authorizations[i];
|
||||
for (name in auth) {
|
||||
for (key in this.authz) {
|
||||
if (key == name) {
|
||||
value = this.authz[key];
|
||||
result = value.apply(obj, authorizations);
|
||||
if (result === true)
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 1.2 support
|
||||
for (name in authorizations) {
|
||||
for (key in this.authz) {
|
||||
if (key == name) {
|
||||
value = this.authz[key];
|
||||
result = value.apply(obj, authorizations);
|
||||
if (result === true)
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user