Skip to content

Commit

Permalink
new system config for OIDC authorization url
Browse files Browse the repository at this point in the history
  • Loading branch information
cerhardt committed Jun 20, 2023
1 parent a2f111a commit b29d4ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions PseudoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function __construct() {
$this->callbackUrl = $this->moduleIndex;

// API Authentication
$this->authorization_url = $this->getSystemSetting("authorization_url");
$this->client_id = $this->getSystemSetting("client_id"); // The client ID assigned to you by the provider
$this->client_secret = $this->getSystemSetting("secret"); // The client password assigned to you by the provider

Expand Down Expand Up @@ -89,10 +90,10 @@ public function login() {
if ($GLOBALS['_SERVER']['SERVER_NAME'] != $this->getSystemSetting("allowed_domain")) {
exit('Zugriff verweigert!');
}
if (strlen($this->sap_url) == 0) {
exit('SAP URL fehlt!');
if (strlen($this->authorization_url) == 0) {
exit('Authorisierungs URL fehlt!');
}
$host = parse_url($this->sap_url, PHP_URL_HOST);
$host = parse_url($this->authorization_url, PHP_URL_HOST);

$provider = new \League\OAuth2\Client\Provider\GenericProvider([
'clientId' => $this->client_id, // The client ID assigned to you by the provider
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ This modul uses these components:
| gPAS Domain API URL | API URL for gPAS Domain Manager |
| gPAS Domain Scope | gPAS Domains Scope (OIDC) |
| gPAS Scope | gPAS Scope (OIDC) |
| OAuth2 Client ID | Client ID for OIDC Authentification |
| OAuth2 Client secret | Secret for OIDC Authentification |
| OAuth2 Authorization URL | Authorization URL for OIDC |
| OAuth2 Client ID | Client ID for OIDC |
| OAuth2 Client secret | Secret for OIDC |
| SAP API URL | API URL SAP search |
| SAP Scope | SAP search Scope (OIDC) |
| use proxy | use REDCap system proxy for http(s) |
Expand Down
6 changes: 6 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
"required": true,
"type": "text"
},
{
"key": "authorization_url",
"name": "Authorization Server URL",
"required": true,
"type": "text"
},
{
"key": "client_id",
"name": "OAuth2 Client ID",
Expand Down

0 comments on commit b29d4ba

Please sign in to comment.