Skip to content

Commit

Permalink
Use laravel oidc package (#15)
Browse files Browse the repository at this point in the history
* Use laravel oidc package

* Add secrets folder

* Use new package

* Update description of config block
  • Loading branch information
ricklambrechts committed Feb 9, 2024
1 parent a2d2538 commit 14c90a7
Show file tree
Hide file tree
Showing 11 changed files with 1,051 additions and 1,343 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
OIDC_ISSUER=""
OIDC_CLIENT_ID=""
OIDC_CLIENT_SECRET=""
OIDC_PRIVATE_KEY_PATH_FOR_JWT=""
OIDC_DECRYPTION_KEY_PATH=""
OIDC_ADDITIONAL_SCOPES=""
OIDC_DECRYPTION_KEY_PATH=""
29 changes: 29 additions & 0 deletions app/Http/Responses/OidcLoginResponseHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace App\Http\Responses;

use MinVWS\OpenIDConnectLaravel\Http\Responses\LoginResponseHandlerInterface;
use Symfony\Component\HttpFoundation\Response;

class OidcLoginResponseHandler implements LoginResponseHandlerInterface
{
/**
* @param object{
* relations: array<int, object{entity_name: string, ura: string, roles: string[]}>,
* initials: ?string,
* surname: ?string,
* surname_prefix: ?string,
* uzi_id: string,
* loa_uzi: string,
* loa_authn: string
* } $userInfo
*/
public function handleLoginResponse(object $userInfo): Response
{
return response()
->redirectTo(route('user'))
->with('user', $userInfo);
}
}
4 changes: 3 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace App\Providers;

use App\Http\Responses\OidcLoginResponseHandler;
use Illuminate\Support\ServiceProvider;
use MinVWS\OpenIDConnectLaravel\Http\Responses\LoginResponseHandlerInterface;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -13,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
$this->app->bind(LoginResponseHandlerInterface::class, OidcLoginResponseHandler::class);
}

/**
Expand Down
140 changes: 0 additions & 140 deletions app/Services/Oidc/OidcService.php

This file was deleted.

32 changes: 0 additions & 32 deletions app/Services/Oidc/OpenIdConfiguration.php

This file was deleted.

20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@
"require": {
"php": "^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"jumbojett/openid-connect-php": "^0.9.6",
"guzzlehttp/guzzle": "^7.8",
"laravel/framework": "^8.54",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"web-token/jwt-easy": "^2.2",
"web-token/jwt-signature-algorithm-rsa": "^2.2",
"web-token/jwt-key-mgmt": "^2.2",
"web-token/jwt-encryption": "^2.2",
"web-token/jwt-encryption-algorithm-rsa": "^2.2",
"web-token/jwt-encryption-algorithm-aescbc": "^2.2"
"minvws/openid-connect-php-laravel": "^0.1.0"
},
"require-dev": {
"facade/ignition": "^2.5",
Expand Down Expand Up @@ -64,6 +58,12 @@
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "git",
"url": "git@github.com:minvws/nl-rdo-openid-connect-php-laravel.git"
}
]
}
Loading

0 comments on commit 14c90a7

Please sign in to comment.