[auth] Authorize with oauth2

This commit is contained in:
bodnia
2016-03-13 23:37:10 +02:00
parent 0852d70f41
commit 56c5294c22
5 changed files with 10 additions and 14 deletions

8
dist/swagger-ui.js vendored
View File

@@ -19472,14 +19472,12 @@ SwaggerUi.Views.AuthsCollectionView = Backbone.View.extend({
'use strict';
/* global OAuthSchemeKeys */
/* global redirect_uri */
/* global clientId */
/* global scopeSeparator */
/* global additionalQueryStringParams */
/* global clientSecret */
/* global onOAuthComplete */
/* global OAuthSchemeKeys */
/* global realm */
/*jshint unused:false*/
@@ -19574,8 +19572,8 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
var scopes = _.map(auth.get('scopes'), function (scope) {
return scope.scope;
});
var OAuthSchemeKeys = [];
var state, dets, ep;
window.OAuthSchemeKey = auth.get('title');
window.enabledScopes = scopes;
var flow = auth.get('flow');
@@ -19585,12 +19583,12 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
window.swaggerUi.tokenName = dets.tokenName || 'access_token';
window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
//state = key;
state = OAuthSchemeKey;
}
else if(auth.get('type') === 'oauth2' && flow && (flow === 'application')) {
dets = auth.attributes;
window.swaggerUi.tokenName = dets.tokenName || 'access_token';
this.clientCredentialsFlow(scopes, dets.tokenUrl, '');
this.clientCredentialsFlow(scopes, dets.tokenUrl, OAuthSchemeKey);
return;
}
else if(auth.get('grantTypes')) {