Skip to content

Commit

Permalink
add support for authenticating with RADIUS (#6488)
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish authored Mar 28, 2019
1 parent 0e759be commit 3c917a9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/app/adapters/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default ApplicationAdapter.extend({
userpass: `login/${encodeURIComponent(username)}`,
ldap: `login/${encodeURIComponent(username)}`,
okta: `login/${encodeURIComponent(username)}`,
radius: `login/${encodeURIComponent(username)}`,
token: 'lookup-self',
};
const urlSuffix = authURLs[authBackend];
Expand Down
8 changes: 8 additions & 0 deletions ui/app/helpers/supported-auth-backends.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ const SUPPORTED_AUTH_BACKENDS = [
displayNamePath: 'display_name',
formAttributes: ['role', 'jwt'],
},
{
type: 'radius',
typeDisplay: 'RADIUS',
description: 'Authenticate with your RADIUS username and password.',
tokenPath: 'client_token',
displayNamePath: 'metadata.username',
formAttributes: ['username', 'password'],
},
{
type: 'github',
typeDisplay: 'GitHub',
Expand Down
1 change: 1 addition & 0 deletions ui/app/templates/partials/auth-form/radius.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{partial "partials/userpass-form"}}
9 changes: 9 additions & 0 deletions ui/tests/unit/adapters/cluster-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ module('Unit | Adapter | cluster', function(hooks) {
'auth:userpass options OK'
);

adapter.authenticate({ backend: 'radius', data });
assert.equal('/v1/auth/radius/login/username', url, 'auth:RADIUS url OK');
assert.equal('POST', method, 'auth:RADIUS method OK');
assert.deepEqual(
{ data: { password: 'password' }, unauthenticated: true },
options,
'auth:RADIUS options OK'
);

adapter.authenticate({ backend: 'LDAP', data });
assert.equal('/v1/auth/ldap/login/username', url, 'ldap:userpass url OK');
assert.equal('POST', method, 'ldap:userpass method OK');
Expand Down

0 comments on commit 3c917a9

Please sign in to comment.