This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName %(hostname)s | |
Redirect / https://%(hostname)s/ | |
DocumentRoot "/var/www/html/" | |
</VirtualHost> | |
<VirtualHost *:443> | |
DocumentRoot "/var/www/html/" | |
ServerName %(hostname)s:443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'+ |