Skip to content

Commit

Permalink
OIDC migration
Browse files Browse the repository at this point in the history
* moved from OPENID 2.0 to OIDC
* removed all user management references from site
** Registration
** Password recovery
** email verification
  • Loading branch information
smarcet committed Feb 3, 2020
1 parent a3027f9 commit 7c82a1d
Show file tree
Hide file tree
Showing 71 changed files with 719 additions and 2,171 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,27 @@ CloudAssets:
AuthURL: keystone base url
LocalCopy: false
````

## OIDC

settings for oidc configuration on _ss_environment.php file

````PHP
// OIDC
define('OIDC_CLIENT', '');

define('OIDC_CLIENT_SECRET', '');


//set true on production mode, otherwise false
define('OIDC_VERIFY_HOST',false);
````

on idp under allowed URIs you need to register following one

* https://hostname/openstackidauthenticator

under security settings you need to set Id Token Signed Response Algorithm



7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{
"type": "vcs",
"url": "https://github.com/OpenStackweb/silverstripe-framework"
},
{
"type": "vcs",
"url": "https://github.com/OpenStackweb/OpenID-Connect-PHP"
}
],
"require": {
Expand Down Expand Up @@ -85,7 +89,8 @@
"smarcet/caldavclient": "1.1.7",
"smarcet/silverstripe-cloudassets-swift": "dev-master",
"markguinn/silverstripe-cloudassets": "dev-master",
"php-opencloud/openstack": "dev-master"
"php-opencloud/openstack": "dev-master",
"jumbojett/openid-connect-php": "dev-master"
},
"require-dev": {
"behat/behat": "@stable",
Expand Down
106 changes: 74 additions & 32 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions cron_jobs_scheduler/_config/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ jobs:
cron_expression: "59 11 * * *"
enabled: 1

- name: "OpenStackIdCleanInvalidNoncesAssocsTask"
cron_expression: "00 03 * * *" # run at 0300 AM every day
enabled: 1

- name: "MemberSpammerProcessorTask"
cron_expression: "00 03 * * *" # run at 0300 AM every day
enabled: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function convert2SiteUser()
{
$this->resign();
$this->owner->addToGroupByCode(IFoundationMember::CommunityMemberGroupSlug);
$this->owner->write();
}

/**
Expand All @@ -63,8 +64,8 @@ public function resign()
$document->delete();
}
}

$this->owner->ResignDate = CustomMySQLDatabase::nowRfc2822();
$this->owner->MembershipType = IOpenStackMember::MembershipTypeCommunity;
$this->owner->ResignDate = CustomMySQLDatabase::nowRfc2822();
}

public function onBeforeDelete()
Expand Down Expand Up @@ -94,6 +95,9 @@ public function upgradeToFoundationMember()
$legalAgreement->MemberID = $this->owner->ID;
$legalAgreement->LegalDocumentPageID = 422;
$legalAgreement->write();
$this->owner->MembershipType = IOpenStackMember::MembershipTypeFoundation;
$this->owner->ResignDate = null;
$this->owner->write();
return true;
}
return false;
Expand All @@ -102,7 +106,7 @@ public function upgradeToFoundationMember()
public function isFoundationMember()
{
$res = $this->owner->inGroup(IFoundationMember::FoundationMemberGroupSlug);
$legal_agreements = DataObject::get("LegalAgreement", " LegalDocumentPageID=422 AND MemberID =" . $this->owner->ID);
$legal_agreements = DataObject::get("LegalAgreement", " LegalDocumentPageID = 422 AND MemberID =" . $this->owner->ID);
$res = $res && $legal_agreements->count() > 0;
return $res;
}
Expand Down
2 changes: 2 additions & 0 deletions migrations/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,5 @@ migrations:
- ShanghaiPresentationSlugMigration
- Election2018Migration
- JobCompanyMigrationTask
- DeleteNullEmailMigration
- UpdateMemberShipTypeMigration
15 changes: 1 addition & 14 deletions openstackid/_config/injector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,9 @@ Member:
extensions:
- OpenStackIdMember
Injector:
OpenStackIdMySQLStore:
constructor:
0: %$OpenStackIdDatabaseConnection
Auth_OpenID_Consumer:
constructor:
0: '%$OpenStackIdMySQLStore'
1: '%$SilverStripeSessionWrapper'
Security:
class: OpenStackIdSecurityController
constructor:
0: '%$Auth_OpenID_Consumer'
OpenStackIdAuthenticator:
constructor:
0: '%$MemberRepository'
1: '%$OpenStackIdMySQLStore'
2: '%$Auth_OpenID_Consumer'
OpenStackIdCleanInvalidNoncesAssocsTask:
constructor:
0: '%$OpenStackIdMySQLStore'
1: '%$MemberManager'
Loading

0 comments on commit 7c82a1d

Please sign in to comment.