Skip to content

Integrate and implement a library on login-page#1277

Open
jr-rk wants to merge 1 commit into
custom_dtfrom
implementation_of_library
Open

Integrate and implement a library on login-page#1277
jr-rk wants to merge 1 commit into
custom_dtfrom
implementation_of_library

Conversation

@jr-rk
Copy link
Copy Markdown

@jr-rk jr-rk commented Apr 24, 2026

Problem description

npm install github:dataquest-dev/idp-discovery#release --legacy-peer-deps

@jr-rk jr-rk requested a review from Copilot April 24, 2026 15:37
@jr-rk jr-rk self-assigned this Apr 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR integrates the @dspace/idp-discovery library into the Angular login page to allow users to select an institution (IdP) and be redirected to a Shibboleth login flow.

Changes:

  • Add @dspace/idp-discovery dependency and lockfile entries.
  • Render <ds-idp-discovery> on the login page and handle IdP selection via a redirect.
  • Provide IDP_DISCOVERY_CONFIG application-wide for the discovery component.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/themes/custom/app/login-page/login-page.component.ts Adds IdpDiscoveryComponent to themed login page standalone imports.
src/app/login-page/login-page.component.ts Imports IdpDiscoveryComponent and adds onIdpSelected redirect handler.
src/app/login-page/login-page.component.html Adds <ds-idp-discovery> to the login page template.
src/app/app.config.ts Registers IDP_DISCOVERY_CONFIG provider for discovery feed/service text.
package.json Adds @dspace/idp-discovery GitHub dependency reference.
package-lock.json Locks the new dependency and updates transitive dependency graph.

Comment on lines +103 to +105
onIdpSelected(idp: { entityID: string }): void {
const loginEndpoint = 'https://lindat.mff.cuni.cz/Shibboleth.sso/Login';
window.location.href = `${loginEndpoint}?entityID=${encodeURIComponent(idp.entityID)}`;
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

onIdpSelected hardcodes the Shibboleth login endpoint URL in the component. This makes the login behavior environment-specific and hard to change across deployments; consider moving the endpoint into configuration (e.g., extending the existing IDP_DISCOVERY_CONFIG or app config) and injecting/reading it here instead of inlining the URL.

Copilot uses AI. Check for mistakes.
Comment on lines +103 to +106
onIdpSelected(idp: { entityID: string }): void {
const loginEndpoint = 'https://lindat.mff.cuni.cz/Shibboleth.sso/Login';
window.location.href = `${loginEndpoint}?entityID=${encodeURIComponent(idp.entityID)}`;
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

New redirect behavior in onIdpSelected isn’t covered by the existing LoginPageComponent unit tests. Please add a spec verifying that the selected IdP’s entityID is URL-encoded and that navigation is triggered with the expected URL (mock/spyon window.location or wrap navigation in an injectable service to test safely).

Copilot generated this review using guidance from organization custom instructions.
Comment thread src/app/app.config.ts
Comment on lines +161 to +167
provide: IDP_DISCOVERY_CONFIG,
useValue: {
feedUrl: "https://lindat.mff.cuni.cz/Shibboleth.sso/DiscoFeed",
serviceName: 'Sign in via your institution',
helpText: 'If you cannot find your institution, use local login.',
maxResults: 25,
},
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The IDP_DISCOVERY_CONFIG provider hardcodes a deployment-specific feedUrl directly in app.config.ts. To keep environments configurable (and avoid editing code for different deployments), consider sourcing this from the existing app/environment configuration instead of inlining the URL here.

Copilot uses AI. Check for mistakes.
Comment thread package.json
"@angular/platform-server": "^20.3.14",
"@angular/router": "^20.3.14",
"@angular/ssr": "^20.3.10",
"@dspace/idp-discovery": "github:dataquest-dev/idp-discovery#release",
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

@dspace/idp-discovery is referenced via github:...#release (a moving branch/tag name). This can lead to non-reproducible installs when the release ref moves; prefer pinning to an immutable tag/version or a specific commit SHA (and keep the lockfile in sync).

Suggested change
"@dspace/idp-discovery": "github:dataquest-dev/idp-discovery#release",
"@dspace/idp-discovery": "github:dataquest-dev/idp-discovery#<PINNED_COMMIT_SHA>",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants