Skip to content

Commit

Permalink
Validate the Authentication Realm type as well
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed May 5, 2022
1 parent 4fa6973 commit b277463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/cloud/public/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('Cloud Plugin', () => {
config: { full_story: { enabled: true, org_id: 'foo' }, id: 'esOrg1' },
currentUserProps: {
username: '1234',
authentication_realm: { name: 'cloud-saml-kibana' },
authentication_realm: { type: 'saml', name: 'cloud-saml-kibana' },
},
});

Expand All @@ -167,7 +167,7 @@ describe('Cloud Plugin', () => {
config: { full_story: { enabled: true, org_id: 'foo' }, id: 'esOrg2' },
currentUserProps: {
username: '1234',
authentication_realm: { name: 'cloud-saml-kibana' },
authentication_realm: { type: 'saml', name: 'cloud-saml-kibana' },
},
});

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/cloud/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ export const loadFullStoryUserId = async ({

if (
getIsCloudEnabled(cloudDeploymentId) &&
currentUser.authentication_realm?.type === 'saml' &&
currentUser.authentication_realm?.name === 'cloud-saml-kibana'
) {
return currentUser.username;
Expand Down

0 comments on commit b277463

Please sign in to comment.