intershop-pwa icon indicating copy to clipboard operation
intershop-pwa copied to clipboard

feat: activate identity provider on specific url path

Open Eisie96 opened this issue 1 year ago • 3 comments

PR Type

[ ] Bugfix [ x ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no API changes) [ ] Build-related changes [ ] CI-related changes [ ] Documentation content changes [ ] Application / infrastructure changes [ ] Other:

What Is the Current Behavior?

Currently the PWA can only be setup with one active identity provider. The PWA should be configured for specific identity providers in such a way, that these are active, when the PWA is rendered with a specific url path. The punchout identity provider should be used, when the 'punchout' feature is active and the PWA is initially loaded with /punchout.

Issue Number: Closes #

What Is the New Behavior?

The activeOnPath property is introduced for the IdentityProviderImplementor interface. When the current url path matches the configured value, then the new identity provider is used. If no url path has a match with the available identity providers, then the old behavior is used.

Furthermore all identity provider guards and interceptors are adapted to wait until a active identity provider is found.

Does this PR Introduce a Breaking Change?

[ ] Yes [ x ] No

Other Information

AB#88708

Eisie96 avatar Aug 17 '23 12:08 Eisie96

🥇

kepek avatar Aug 24 '23 12:08 kepek

There is still a problem:

  1. Login as punchout user, e.g. localhost:4201/[email protected]&PASSWORD=!InterShop00!&HOOK_URL=https://punchoutcommerce.com/tools/oci-roundtrip-return
  2. Logout
  3. Go to Login Page
  4. An error page occurs:

image

SGrueber avatar Oct 23 '23 16:10 SGrueber

There is still a problem:

  1. Login as punchout user, e.g. localhost:4201/punchout?USERNAME=[email protected]&PASSWORD=!InterShop00!&HOOK_URL=https://punchoutcommerce.com/tools/oci-roundtrip-return
  2. Logout
  3. Go to Login Page
  4. An error page occurs:

image

This is a known issue in Development and has nothing to do with the PR. The punchout idp is configured to be active, when the /punchout route is used during the PWA initialization. The identity provider expects, that the punchout route has certain login parameter. Within the PWA it is configured, that the /punchout route redirects to the /login route in order to use the triggerLogin() function.

In the use case it is described, that the user enters the /login page after successful logout. During the runtime of the PWA the punchout identity provider is still active. That's why the idp expects, that the /login route contains necessary parameter to login the punchout user.

Eisie96 avatar Oct 24 '23 13:10 Eisie96