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 JWT auth type to MultipleAuthentication #2105

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 14 additions & 1 deletion server/auth/types/multiple/multi_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { composeNextUrlQueryParam } from '../../../utils/next_url';
import { MultiAuthRoutes } from './routes';
import { SecuritySessionCookie } from '../../../session/security_cookie';
import { BasicAuthentication, OpenIdAuthentication, SamlAuthentication } from '../../types';
import { BasicAuthentication, OpenIdAuthentication, SamlAuthentication, JwtAuthentication } from '../../types';

Check failure on line 32 in server/auth/types/multiple/multi_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Replace `·BasicAuthentication,·OpenIdAuthentication,·SamlAuthentication,·JwtAuthentication·` with `⏎··BasicAuthentication,⏎··OpenIdAuthentication,⏎··SamlAuthentication,⏎··JwtAuthentication,⏎`

Check failure on line 32 in server/auth/types/multiple/multi_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-latest)

Replace `·BasicAuthentication,·OpenIdAuthentication,·SamlAuthentication,·JwtAuthentication·` with `␍⏎··BasicAuthentication,␍⏎··OpenIdAuthentication,␍⏎··SamlAuthentication,␍⏎··JwtAuthentication,␍⏎`

export class MultipleAuthentication extends AuthenticationType {
private authTypes: string | string[];
Expand Down Expand Up @@ -93,6 +93,19 @@
this.authHandlers.set(AuthType.SAML, SamlAuth);
break;
}
case AuthType.JWT: {
const JwtAuth = new JwtAuthentication(
this.config,
this.sessionStorageFactory,
this.router,
this.esClient,
this.coreSetup,
this.logger
);
await JwtAuth.init();
this.authHandlers.set(AuthType.JWT, JwtAuth);
break;
}
default: {
throw new Error(`Unsupported authentication type: ${this.authTypes[i]}`);
}
Expand Down
Loading