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

MEN-7277 - show SSO info depending on configured SSO type #4423

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

mzedel
Copy link
Contributor

@mzedel mzedel commented May 24, 2024

No description provided.

@mender-test-bot
Copy link
Contributor

@mzedel, Let me know if you want to start the integration pipeline by mentioning me and the command "start pipeline".


my commands and options

You can trigger a pipeline on multiple prs with:

  • mentioning me and start pipeline --pr mender/127 --pr mender-connect/255

You can start a fast pipeline, disabling full integration tests with:

  • mentioning me and start pipeline --fast

You can trigger GitHub->GitLab branch sync with:

  • mentioning me and sync

You can cherry pick to a given branch or branches with:

  • mentioning me and:
 cherry-pick to:
 * 1.0.x
 * 2.0.x

Copy link
Contributor

@merlin-northern merlin-northern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a slight problem when I choose OIDC as SSO method (see also the recording on priv):
in the dev mode:

helpers.js:534 Uncaught TypeError: _constants_organizationConstants_js__WEBPACK_IMPORTED_MODULE_6__.SSO_TYPES.find is not a function
    at getSsoByType (helpers.js:534:47)
    at organization.js:162:40
    at handleChange (InputBase.js:364:1)
    at SelectInput.js:291:1
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
    at invokeGuardedCallback (react-dom.development.js:4277:1)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
    at executeDispatch (react-dom.development.js:9041:1)
    at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)

and in regular prod build:

helpers.js:534 Uncaught TypeError: u.c0.find is not a function
    at ne (helpers.js:534:47)
    at organization.js:162:28
    at onChange (InputBase.js:364:7)
    at SelectInput.js:291:9
    at Object.Re (react-dom.production.min.js:54:317)
    at ze (react-dom.production.min.js:54:471)
    at react-dom.production.min.js:55:35
    at Nn (react-dom.production.min.js:105:68)
    at Bn (react-dom.production.min.js:106:380)
    at react-dom.production.min.js:117:104

@mzedel
Copy link
Contributor Author

mzedel commented May 27, 2024

Thanks for taking a look @merlin-northern! Based on this error I looked again into the API specs for the SSO config retrieval here and I think for this task to provide a correct set of links the backend needs to return the type of config along with the id and issuer...

@merlin-northern
Copy link
Contributor

Thanks for taking a look @merlin-northern! Based on this error I looked again into the API specs for the SSO config retrieval here and I think for this task to provide a correct set of links the backend needs to return the type of config along with the id and issuer...

I can fix that.

…pe of SSO

- slightly improved encapsulation of SSO method information

Ticket: None
Changelog: Title
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…f SSO configured

Ticket: MEN-7277
Changelog: Title
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
@mender-test-bot
Copy link
Contributor

mender-test-bot commented May 27, 2024

Merging these commits will result in the following changelog entries:

Changelogs

gui (men-7277)

New changes in gui since master:

Bug Fixes
  • fixed SSO information not being adjusted depending on the type of SSO configured
    (MEN-7277)
  • fixed an issue that could prevent SSO logins depending on the type of SSO

Copy link
Contributor

@merlin-northern merlin-northern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. also tested with the SAML and OIDC metadata upload and start of the login process.

Comment on lines 83 to 89
if (contentType.includes(APPLICATION_JSON_CONTENT_TYPE)) {
const { id } = response;
const ssoLoginUrl = getSsoStartUrlById(id);
const { id, kind } = response;
const type = kind.split('/')[1];
const ssoLoginUrl = SSO_TYPES[type].getStartUrl(id);
window.location.replace(ssoLoginUrl);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I havent tested this flow, lets do it on staging.

@mzedel mzedel merged commit fb1ac19 into mendersoftware:master Jun 4, 2024
4 of 5 checks passed
@mender-test-bot
Copy link
Contributor

Hello 😺 This PR contains changelog entries. Please, verify the need of backporting it to the following release branches:
3.7.x (release 3.7.x)
3.6.x (release 3.6.x)
3.7.x (release 3.7.x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants