Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for authenticating with RADIUS #6488

Merged
merged 1 commit into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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