intershop-pwa
intershop-pwa copied to clipboard
feat: activate identity provider on specific url path
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
🥇
There is still a problem:
- Login as punchout user, e.g. localhost:4201/[email protected]&PASSWORD=!InterShop00!&HOOK_URL=https://punchoutcommerce.com/tools/oci-roundtrip-return
- Logout
- Go to Login Page
- An error page occurs:
There is still a problem:
- Login as punchout user, e.g. localhost:4201/punchout?USERNAME=[email protected]&PASSWORD=!InterShop00!&HOOK_URL=https://punchoutcommerce.com/tools/oci-roundtrip-return
- Logout
- Go to Login Page
- An error page occurs:
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.