Add an endpoint to return active authentication providers
This endpoint can be used by Angular to figure out what authentication options to display to the user. It returns a dictionary of configuration details that the front-end needs for each provider.
This commit is contained in:
@ -12,6 +12,7 @@ angular.module('lemur')
|
||||
$scope.login = AuthenticationService.login;
|
||||
$scope.authenticate = AuthenticationService.authenticate;
|
||||
$scope.logout = AuthenticationService.logout;
|
||||
$scope.get_providers = AuthenticationService.get_providers;
|
||||
|
||||
UserService.getCurrentUser().then(function (user) {
|
||||
$scope.currentUser = user;
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="login">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<button class="btn btn-block btn-default" ng-click="authenticate('Example')">
|
||||
Login with Example
|
||||
<button class="btn btn-block btn-default" ng-repeat="(key, value) in get_providers()" ng-click="authenticate(key)">
|
||||
Login with {{key}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,6 +6,10 @@ angular.module('lemur')
|
||||
.service('AuthenticationService', function ($location, $rootScope, AuthenticationApi, UserService, toaster, $auth) {
|
||||
var AuthenticationService = this;
|
||||
|
||||
AuthenticationService.get_providers = function () {
|
||||
return AuthenticationApi.one('providers').get();
|
||||
};
|
||||
|
||||
AuthenticationService.login = function (username, password) {
|
||||
AuthenticationApi.customPOST({'username': username, 'password': password}, 'login')
|
||||
.then(
|
||||
|
Reference in New Issue
Block a user