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

Add config for identity_providers in local_info.xml #524

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Sae126V
Copy link
Contributor

@Sae126V Sae126V commented Sep 11, 2024

Resolves GT-472 and GT-471

config/local_info.xsd Outdated Show resolved Hide resolved
}

$this->principal = $_SERVER['voPersonID'];
$this->userDetails = ['AuthenticationRealm' => [$provider['idp']]];
Copy link
Member

Choose a reason for hiding this comment

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

This probably shouldn't just be the IdP. For EGI Check In, it should be "EGI Proxy IdP" - this should defined in the local config in the provider block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep Make sense. Added this in 7e7396c

@Sae126V Sae126V force-pushed the GT-471-Shib/CheckIn-Token-reads-config-file branch 3 times, most recently from 694c0b2 to 7e7396c Compare September 13, 2024 10:48
@Sae126V Sae126V marked this pull request as ready for review September 13, 2024 10:53
@Sae126V Sae126V requested a review from a team as a code owner September 13, 2024 10:53
@Sae126V Sae126V force-pushed the GT-471-Shib/CheckIn-Token-reads-config-file branch from 7e7396c to 11b2a67 Compare September 16, 2024 08:10
Comment on lines +192 to +194
<authentication_realms>
<shib_realm_name>EGI Proxy IdP</shib_realm_name>
</authentication_realms>
Copy link
Member

@gregcorbett gregcorbett Nov 14, 2024

Choose a reason for hiding this comment

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

This can just be authentication_realm

Suggested change
<authentication_realms>
<shib_realm_name>EGI Proxy IdP</shib_realm_name>
</authentication_realms>
<authentication_realm>
EGI Proxy IdP
</authentication_realm>

Comment on lines +203 to +205
<authentication_realms>
<shib_realm_name>EGI Proxy IdP</shib_realm_name>
</authentication_realms>
Copy link
Member

Choose a reason for hiding this comment

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

As with https://github.com/GOCDB/gocdb/pull/524/files#r1842006878

Suggested change
<authentication_realms>
<shib_realm_name>EGI Proxy IdP</shib_realm_name>
</authentication_realms>
<authentication_realm>
EGI Proxy IdP
</authentication_realm>

if (empty($_SERVER['voPersonID'])) {
die(
"Did not receive required attributes from the "
. "IDP $name to complete authentication. "
Copy link
Member

Choose a reason for hiding this comment

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

I think this will read better

Suggested change
. "IDP $name to complete authentication. "
. "$name to complete authentication. "

if (empty($_SERVER['entitlement'])) {
die(
"Did not receive the required entitlement "
. "attribute from the IDP $name. "
Copy link
Member

Choose a reason for hiding this comment

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

I think this will read better

Suggested change
. "attribute from the IDP $name. "
. "attribute from the $name. "

) {
$HTML = "<ul>"
. "<li>Login requires a GOCDB entitlement value "
. "which was not provided for the IDP $name.</li>"
Copy link
Member

Choose a reason for hiding this comment

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

I think this will read better

Suggested change
. "which was not provided for the IDP $name.</li>"
. "which was not provided for the $name.</li>"


$this->principal = $_SERVER['voPersonID'];
$this->userDetails = [
'AuthenticationRealm' => $provider['authenticationRealms']
Copy link
Member

Choose a reason for hiding this comment

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

Given https://github.com/GOCDB/gocdb/pull/524/files#r1842006878, this will need a slight tweak

$localInfo = $this->GetLocalInfoXML();
$identityProviders = [];

if (!empty($localInfo->identity_providers->provider)) {
Copy link
Member

Choose a reason for hiding this comment

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

What happens here if identity_providers is omitted in it's entirety from the local_config.xml?

Comment on lines +576 to +581
if (!empty($localInfo->identity_providers->provider)) {
foreach (
$localInfo
->identity_providers
->provider as $providerDetails
) {
Copy link
Member

Choose a reason for hiding this comment

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

Something like this I think would read better

Suggested change
if (!empty($localInfo->identity_providers->provider)) {
foreach (
$localInfo
->identity_providers
->provider as $providerDetails
) {
$configured_providers = $localInfo->identity_providers->provider;
if (!empty($configured_providers)) {
foreach ($configured_providers as $providerDetails) {


/** authentication_realms */
$authenticationRealms = [];
if ($providerDetails->authentication_realms) {
Copy link
Member

Choose a reason for hiding this comment

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

Given https://github.com/GOCDB/gocdb/pull/524/files#r1842006878, this will need a slight tweak

$identityProviders[] = [
'idp' => $idp,
'name' => $name,
'authenticationRealms' => $authenticationRealms,
Copy link
Member

Choose a reason for hiding this comment

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

Given https://github.com/GOCDB/gocdb/pull/524/files#r1842006878

Suggested change
'authenticationRealms' => $authenticationRealms,
'authenticationRealm' => $authenticationRealm,

Copy link
Member

@gregcorbett gregcorbett left a comment

Choose a reason for hiding this comment

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

A few minor changes are needed.

@gregcorbett gregcorbett self-assigned this Nov 14, 2024
@gregcorbett gregcorbett added this to the September 2024 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants