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

Update ember-acmidm-login to v2 #471

Merged
merged 5 commits into from
May 31, 2023
Merged

Conversation

elpoelma
Copy link
Contributor

@elpoelma elpoelma commented May 24, 2023

This PR introduces an update to ember-acmidm-login 2.0.0-beta.1. The new version removes the dependency on the outdated torii dependency which is not compatible with ember 4+. The new version of ember-acmidm-login additionally no longer provides UI components.

Aside from the update, this PR introduces a restructure of the auth routes, it provides the following routes:

  • an authorization.login route: this is a route which sends the user to an acmidm login page or the mock-login page
  • an authorization.logout route: this is a route which invalidates the users session and sends them to the dedicated acmidm page, or back to the mock-login page
  • an authorization.callback route: this route serves as the callback route where users are sent too after a successful login, it receives a code parameter and authenticates the user
  • an authorization.switch route: this route invalidates the current session and sends the user to an acmidm switch url or the mock-login page.

TODO:

  • Test the acmidm integration itself

This restructure is based on lblod/frontend-loket#282.

@elpoelma elpoelma self-assigned this May 24, 2023
Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

I can log in and out with itsme, but the "switch" flow doesn't work. It gives me a 400 BAD REQUEST
this is the request URL:
https://authenticatie-ti.vlaanderen.be/op/v1/logout?switch=true&client_id=68b1585d-0e13-4817-820e-c475207673ed&post_logout_redirect_uri=https%3A%2F%2Fgelinkt-notuleren.lblod.info%2Fauthorization%2Fswitch

these are my environment settings for the frontend:

      EMBER_OAUTH_API_KEY: "68b1585d-0e13-4817-820e-c475207673ed"
      EMBER_OAUTH_BASE_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/auth"
      EMBER_OAUTH_REDIRECT_URL: "https://gelinkt-notuleren.lblod.info/authorization/callback"
      EMBER_OAUTH_LOGOUT_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/logout"
      EMBER_OAUTH_SWITCH_URL: "https://gelinkt-notuleren.lblod.info/authorization/switch"

EDIT:
turns out I had the wrong switch url, it still needs to be https://gelinkt-notuleren.lblod.info/switch-login
I was confused cause that route was commented out in the PR

Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

the login page shows "logout" even when not logged in:
image
clicking on it actually starts the login flow

Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

when anything goes wrong, there are empty alert boxes with no information:
image
this is after opening the login popup, and then closing it again without logging in

@nvdk
Copy link
Member

nvdk commented May 24, 2023

FYI: These last two errors already existed before, but would be nice to get them fixed :)

@elpoelma
Copy link
Contributor Author

the login page shows "logout" even when not logged in: image clicking on it actually starts the login flow

Normally, these issues should have been fixed, are you sure you tested on the latest version of this branch? I'm getting
image

@elpoelma
Copy link
Contributor Author

I can log in and out with itsme, but the "switch" flow doesn't work. It gives me a 400 BAD REQUEST this is the request URL: https://authenticatie-ti.vlaanderen.be/op/v1/logout?switch=true&client_id=68b1585d-0e13-4817-820e-c475207673ed&post_logout_redirect_uri=https%3A%2F%2Fgelinkt-notuleren.lblod.info%2Fauthorization%2Fswitch

these are my environment settings for the frontend:

      EMBER_OAUTH_API_KEY: "68b1585d-0e13-4817-820e-c475207673ed"
      EMBER_OAUTH_BASE_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/auth"
      EMBER_OAUTH_REDIRECT_URL: "https://gelinkt-notuleren.lblod.info/authorization/callback"
      EMBER_OAUTH_LOGOUT_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/logout"
      EMBER_OAUTH_SWITCH_URL: "https://gelinkt-notuleren.lblod.info/authorization/switch"

EDIT: turns out I had the wrong switch url, it still needs to be https://gelinkt-notuleren.lblod.info/switch-login I was confused cause that route was commented out in the PR

My bad, I uncommented the switch-login route, does it work if it is a configured with the switch-login url?

@elpoelma elpoelma requested a review from abeforgit May 25, 2023 09:00
Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

works with local testing 👏

@abeforgit abeforgit merged commit cecd37a into master May 31, 2023
@abeforgit abeforgit deleted the internal/update-ember-acm-idm branch May 31, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants