mirror of https://github.com/portainer/portainer
feat(oauth): add providers to providers-selector
parent
c1939f6070
commit
90281fd7f0
|
@ -9,9 +9,9 @@
|
|||
class="form-control"
|
||||
id="oauth-provider-selector"
|
||||
ng-model="$ctrl.selectedProvider"
|
||||
ng-options="provider as provider for provider in $ctrl.providers"
|
||||
ng-change="$ctrl.onSelect($ctrl.selectedProvider)"
|
||||
ng-options="provider as provider.name for provider in $ctrl.providers"
|
||||
>
|
||||
<option value="">Custom </option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,20 @@
|
|||
angular.module('portainer.extensions.oauth')
|
||||
.component('oauthProvidersSelector', {
|
||||
templateUrl: 'app/extensions/oauth/components/oauth-providers-selector/oauth-providers-selector.html'
|
||||
});
|
||||
angular.module('portainer.extensions.oauth').component('oauthProvidersSelector', {
|
||||
templateUrl: 'app/extensions/oauth/components/oauth-providers-selector/oauth-providers-selector.html',
|
||||
bindings: {
|
||||
onSelect: '<'
|
||||
},
|
||||
controller: function oauthProvidersSelectorController() {
|
||||
this.providers = [
|
||||
{
|
||||
name: 'Facebook',
|
||||
authUrl: 'https://www.facebook.com/v3.2/dialog/oauth',
|
||||
accessTokenUrl: 'https://graph.facebook.com/v3.2/oauth/access_token',
|
||||
resourceUrl: 'https://graph.facebook.com/v3.2/me?fields=email',
|
||||
userIdentifier: 'email'
|
||||
},
|
||||
{
|
||||
name: 'Custom'
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
angular.module('portainer.extensions.oauth')
|
||||
.controller('OAuthSettingsController', function OAuthSettingsController() {
|
||||
this.providers = [
|
||||
'facebook'
|
||||
]
|
||||
});
|
||||
.controller('OAuthSettingsController', function OAuthSettingsController() {
|
||||
this.onSelectProvider = onSelectProvider;
|
||||
|
||||
function onSelectProvider(provider) {
|
||||
this.settings.AuthorizationURI = provider.authUrl;
|
||||
this.settings.AccessTokenURI = provider.accessTokenUrl;
|
||||
this.settings.ResourceURI = provider.resourceUrl;
|
||||
this.settings.UserIdentifier = provider.userIdentifier;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div>
|
||||
<!-- <oauth-providers-selector selected-provider="$ctrl.settings.provider" providers="$ctrl.providers"></oauth-providers-selector> -->
|
||||
<!-- <oauth-providers-selector on-select="$ctrl.onSelectProvider" selected-provider="$ctrl.settings.provider" providers="$ctrl.providers"></oauth-providers-selector> -->
|
||||
|
||||
<div class="col-sm-12 form-section-title">OAuth Configuration</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue