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

added SAML stuff, no testing #33

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProjectRegionController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers\Api;
namespace App\Http\Controllers;

use App\Models\ProjectRegion;
use Illuminate\Http\Request;
Expand Down
4 changes: 3 additions & 1 deletion app/Models/Team.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App;
<?php

namespace App\Models;

use Mpociot\Teamwork\TeamworkTeam;

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
"arrilot/laravel-widgets": "^3.14",
"avadim/fast-excel-laravel": "^2.7",
"brunocfalcao/blade-feather-icons": "^4.0",
"codegreencreative/laravel-samlidp": "^5.2",
"filament/filament": "*",
"glorand/laravel-model-settings": "^7.0",
"graham-campbell/markdown": "^15.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/socialite": "^5.16",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.5",
"livewire/livewire": "^3.5",
Expand Down
1,619 changes: 1,114 additions & 505 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
'throw' => false,
],

'samlidp' => [
'driver' => 'local',
'root' => storage_path() . '/samlidp',
]

],

/*
Expand Down
98 changes: 98 additions & 0 deletions config/samlidp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php

use LightSaml\SamlConstants;
// look here for more instructions - https://github.com/codegreencreative/laravel-samlidp
return [
/*
|--------------------------------------------------------------------------
| SAML idP configuration file
|--------------------------------------------------------------------------
|
| Use this file to configure the service providers you want to use.
| using https://auth0.com/docs/authenticate/single-sign-on/outbound-single-sign-on/configure-auth0-saml-identity-provider
|
*/
// Outputs data to your laravel.log file for debugging
'debug' => false,
// Define the email address field name in the users table
'email_field' => 'email',
// Define the Name ID for the email field.
'email_name_id' => SamlConstants::NAME_ID_FORMAT_EMAIL,
// Define the name field in the users table
'name_field' => 'name',
// The URI to your login page
'login_uri' => 'login',
// Log out of the IdP after SLO
'logout_after_slo' => env('LOGOUT_AFTER_SLO', false),
// The URI to the saml metadata file, this describes your idP
'issuer_uri' => 'saml/metadata',
// The certificate
'cert' => env('SAMLIDP_CERT'),
// Name of the certificate PEM file, ignored if cert is used
'certname' => 'cert.pem',
// The certificate key
'key' => env('SAMLIDP_KEY'),
// Name of the certificate key PEM file, ignored if key is used
'keyname' => 'key.pem',
// Encrypt requests and responses
'encrypt_assertion' => true,
// Make sure messages are signed
'messages_signed' => true,
// Defind what digital algorithm you want to use
'digest_algorithm' => \RobRichards\XMLSecLibs\XMLSecurityDSig::SHA1,
// list of all service providers
'sp' => [
'aHR0cHM6Ly9zc28uZXUuYm94eWhxLmNvbS9hcGkvb2F1dGgvc2FtbA==' => [
'destination' => 'https://dev-2chzmog6napfcdtt.au.auth0.com/samlp/pPTroNbna0sFS1SWQbgJQgCghV2lystc',
'logout' => '/',
'certificate' => '-----BEGIN CERTIFICATE-----
MIIDHTCCAgWgAwIBAgIJSlUtlFpMzKrpMA0GCSqGSIb3DQEBCwUAMCwxKjAoBgNV
BAMTIWRldi0yY2h6bW9nNm5hcGZjZHR0LmF1LmF1dGgwLmNvbTAeFw0yNTAxMDgw
MTI3MTNaFw0zODA5MTcwMTI3MTNaMCwxKjAoBgNVBAMTIWRldi0yY2h6bW9nNm5h
cGZjZHR0LmF1LmF1dGgwLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAKjFbpAhR6NpKL59wPv614LZ23dPSD+zT/jdsraZJFQimXThtvVylwGy8QRJ
0FpfFPoPd9iPHDoWUaY7IJa6zIeHVmZURMPTj4WlRnZsEOlp3Q53yUWRCKNq2UBG
U1cgv0fe7gisZu29/btHOzuQnu1sSO9W87kI0/H/wpZeDDzbzSEZEe1CwFpKvT7g
VO8MTmnz58WhpVz2x5Dto2oY0MwVnECX9/9r85dBXhHoWlHieVRq3G1qx9OY/qxH
jID9JawwpVGPL3ZGjZlxlQBg9PW+kzG98xvU1Pduxnopfk12jKzZGPG7fmJWH9sE
SES7RgDpg+mI3T3qWEvpkGX9vyMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAd
BgNVHQ4EFgQUHIHhck95+7ubXAjBjE6ylhVlZaUwDgYDVR0PAQH/BAQDAgKEMA0G
CSqGSIb3DQEBCwUAA4IBAQCFifgHkbzjUMKnzuBY8YsItjqE+TX189yzw9zVX/Ka
/3ef6PUHWvWpV5nlyLC5Q4kxz7Gtj3Bl4v2uJ2gGKBpt1QBZzgI1bFTBouggEoni
suWZMaR0SFOb8uKkxKbfeHHU7bW1DwYflGBo98oUdK3xODEXecfIL/Bwhl0BvYeS
ZoqDhGSWpgVSSPXkTfnSCg8Vb45t7xw/IVGM+nIGq33u410+X1Qd04+4sBBl9m3r
Tz2PxFzezhgvUkYEOA3taAsW0Fe+KGdDMPprgQrTRpdx+sSBdZ5umv6ZlGLkwVIZ
xxG++RYwpwUDVjYOURUfk/4lQADNnsUc128kU158xqdv
-----END CERTIFICATE-----',
]
// Base64 encoded ACS URL
// 'aHR0cHM6Ly9teWZhY2Vib29rd29ya3BsYWNlLmZhY2Vib29rLmNvbS93b3JrL3NhbWwucGhw' => [
// // Your destination is the ACS URL of the Service Provider
// 'destination' => 'https://myfacebookworkplace.facebook.com/work/saml.php',
// 'logout' => 'https://myfacebookworkplace.facebook.com/work/sls.php',
// // SP certificate
// 'certificate' => '',
// // Turn off auto appending of the idp query param
// 'query_params' => false,
// // Turn off the encryption of the assertion per SP
// 'encrypt_assertion' => false
// ]
],

// If you need to redirect after SLO depending on SLO initiator
// key is beginning of HTTP_REFERER value from SERVER, value is redirect path
'sp_slo_redirects' => [
// 'https://example.com' => 'https://example.com',
],

// All of the Laravel SAML IdP event / listener mappings.
'events' => [
'CodeGreenCreative\SamlIdp\Events\Assertion' => [],
'Illuminate\Auth\Events\Logout' => ['CodeGreenCreative\SamlIdp\Listeners\SamlLogout'],
'Illuminate\Auth\Events\Authenticated' => ['CodeGreenCreative\SamlIdp\Listeners\SamlAuthenticated'],
'Illuminate\Auth\Events\Login' => ['CodeGreenCreative\SamlIdp\Listeners\SamlLogin'],
],

// List of guards saml idp will catch Authenticated, Login and Logout events
'guards' => ['web'],
];
108 changes: 59 additions & 49 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,73 +1,83 @@
@extends('layouts.app')

@samlidp

@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Login') }}</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Login') }}</div>

<div class="card-body">
<form method="POST" action="{{ route('login') }}">
@csrf
<div class="card-body">
<form method="POST" action="{{ route('login') }}">
@csrf
@samlidp

<div class="row mb-3">
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
<div class="row mb-3">
<label for="email"
class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
<div class="col-md-6">
<input id="email" type="email"
class="form-control @error('email') is-invalid @enderror" name="email"
value="{{ old('email') }}" required autocomplete="email" autofocus>

@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>

<div class="row mb-3">
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
<div class="row mb-3">
<label for="password"
class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>

<div class="col-md-6">
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
<div class="col-md-6">
<input id="password" type="password"
class="form-control @error('password') is-invalid @enderror" name="password"
required autocomplete="current-password">

@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>

<div class="row mb-3">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<div class="row mb-3">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember"
{{ old('remember') ? 'checked' : '' }}>

<label class="form-check-label" for="remember">
{{ __('Remember Me') }}
</label>
<label class="form-check-label" for="remember">
{{ __('Remember Me') }}
</label>
</div>
</div>
</div>
</div>

<div class="row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Login') }}
</button>
<div class="row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Login') }}
</button>

@if (Route::has('password.request'))
<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }}
</a>
@endif
@if (Route::has('password.request'))
<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }}
</a>
@endif
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
6 changes: 1 addition & 5 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

<!-- Styles -->
<link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />



<style>
.skill-entry {
margin-bottom: 10px;
Expand All @@ -29,9 +28,6 @@
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify"></script>
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.polyfills.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>




</head>

Expand Down
22 changes: 22 additions & 0 deletions storage/samlidp/cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDtTCCAp2gAwIBAgIUBh7k6jC0BC17qJErw6JzGcRwacswDQYJKoZIhvcNAQEL
BQAwajELMAkGA1UEBhMCQVUxCzAJBgNVBAgMAldBMQ0wCwYDVQQKDARJVElNMSEw
HwYDVQQDDBhyZXNvdXJjZXMubG9jYWwudGljbS5jb20xHDAaBgkqhkiG9w0BCQEW
DWJyZXRAdGljbS5jb20wHhcNMjUwMTA4MDEwMDE3WhcNNDUwMTAzMDEwMDE3WjBq
MQswCQYDVQQGEwJBVTELMAkGA1UECAwCV0ExDTALBgNVBAoMBElUSU0xITAfBgNV
BAMMGHJlc291cmNlcy5sb2NhbC50aWNtLmNvbTEcMBoGCSqGSIb3DQEJARYNYnJl
dEB0aWNtLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMFk190u
YRyzKSeN2KGgjpLj4GpJ/sPPHP5PRmyM1cAbzxMTYEoRa2NyWNqHJ4OPDdn3ViE/
+jKsVaxUokRIOzuZeIcELGag3iWt/tgAl6ZVbJb8gPEjMZJvCqkw6Sm7KiYwBadw
W2XSyKEgro0ANoN7fMisjE7S/qrIbSenvNj3CeUmie718qK/LxrxLYy4AMiT+ThR
MFbDUXIxlPYb9X2amB9wdGXssZqlZhyJNKxsAK99u8cKukqmmO3XgLSpotn74ywy
C2xnjCyUsAJT09Ek/gc0KB0K8fQRf0iIJkFcWczkU9SCEkz8Ry9WZSRJ0vIprd8I
ULDQbfdGuHp6XF0CAwEAAaNTMFEwHQYDVR0OBBYEFFvIl0rvzHsJjqWfTxiQ1mj2
SOS3MB8GA1UdIwQYMBaAFFvIl0rvzHsJjqWfTxiQ1mj2SOS3MA8GA1UdEwEB/wQF
MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAGlkia7705i/yspY1wSZ5xd9fPEx6KPL
E2ajB/6DbzKH1goxTdVeaOWYc+CczHgC9ymp8ThOXrpm9uXHe32wwBcOUBHgsjYG
0be66qOc9+IrMFnx/71tlutHeKiz352ippOFK70qKwFOqr1i4WsvP6Au9oSeIzL9
l2g3FWnL0fgF8lyPpdXORnoGWYzSKbAV8t/Q/gCqX2Su2Ux+dA8Rfj7TTHzz9Bha
t9juWXWPymf0VOXlRsaabrcUakGgTYaXlOGOPNvVRGb5G7uMWji8Ch0mWugAxHsI
2lvfWOTt7dI04JHnntfchRXXGoP+26VeSU947a4LsRYVd99LRhMBtlc=
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions storage/samlidp/key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBZNfdLmEcsykn
jdihoI6S4+BqSf7Dzxz+T0ZsjNXAG88TE2BKEWtjcljahyeDjw3Z91YhP/oyrFWs
VKJESDs7mXiHBCxmoN4lrf7YAJemVWyW/IDxIzGSbwqpMOkpuyomMAWncFtl0sih
IK6NADaDe3zIrIxO0v6qyG0np7zY9wnlJonu9fKivy8a8S2MuADIk/k4UTBWw1Fy
MZT2G/V9mpgfcHRl7LGapWYciTSsbACvfbvHCrpKppjt14C0qaLZ++MsMgtsZ4ws
lLACU9PRJP4HNCgdCvH0EX9IiCZBXFnM5FPUghJM/EcvVmUkSdLyKa3fCFCw0G33
Rrh6elxdAgMBAAECggEABnQiC/x/O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