Skip to content

Instantly share code, notes, and snippets.

View christian-hawk's full-sized avatar
🔫
Focusing in a (metadata) issue

Christian christian-hawk

🔫
Focusing in a (metadata) issue
View GitHub Profile
@christian-hawk
christian-hawk / inbound-saml.py
Last active September 7, 2022 21:39
inbound-saml
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Christian Eland
#
from org.gluu.service.cdi.util import CdiUtil
from org.gluu.oxauth.security import Identity
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.oxauth.service import AuthenticationService
@christian-hawk
christian-hawk / gluu_https.conf
Last active August 11, 2020 15:50
scripts.ldif install template containing test configuration for passport_social and passport_saml
<VirtualHost *:80>
ServerName %(hostname)s
Redirect / https://%(hostname)s/
DocumentRoot "/var/www/html/"
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www/html/"
ServerName %(hostname)s:443
// Verify using getKey callback
// Example uses https://github.com/auth0/node-jwks-rsa as a way to fetch the keys.
var jwksClient = require('jwks-rsa');
var client = jwksClient({
jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json'
});
function getKey(header, callback){
client.getSigningKey(header.kid, function(err, key) {
var signingKey = key.publicKey || key.rsaPublicKey;
callback(null, signingKey);
@christian-hawk
christian-hawk / output
Created July 20, 2020 23:14
output jwks_post
{
at_hash: 'RiQoEK7-EXWFpsRdk-SDMA',
aud: 'b15478ab-a9d8-430e-b791-415233d09d89',
acr: 'basic',
sub: 'VDsFXrxz-PQw7A-Jk0Sd6RT-izr1IQBxiQboKDpEb-I',
amr: [ '10' ],
auth_time: 1595284865,
iss: 'https://chris.gluutwo.org',
exp: 1595288467,
iat: 1595284867,
@christian-hawk
christian-hawk / index.js
Last active July 20, 2020 23:13
jwks_post
const jwt = require('jsonwebtoken')
const fetch = require('node-fetch')
// shortcut sujo pra aceitar certificados self-signed
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
const MOCKED_JWS = 'eyJraWQiOiIyOWQwNDA2Ny0zY2M4LTQzZTYtYmI4My1mYjhkN2M2M2I1M'+
'Ddfc2lnX3JzMjU2IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJhdF9oYXNoIjoiUmlRb0'+
'VLNy1FWFdGcHNSZGstU0RNQSIsImF1ZCI6ImIxNTQ3OGFiLWE5ZDgtNDMwZS1iNzkxLTQxNTIzM2'+
'QwOWQ4OSIsImFjciI6ImJhc2ljIiwic3ViIjoiVkRzRlhyeHotUFF3N0EtSmswU2Q2UlQtaXpyMU'+