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
/** | |
* Handler that will be called during the execution of a PostLogin flow. | |
* | |
* @param {Event} event - Details about the user and the context in which they are logging in. | |
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login. | |
*/ | |
exports.onExecutePostLogin = async (event, api) => { | |
// Craft a signed session token | |
const token = api.redirect.encodeToken({ | |
secret: 'keyboardcat', // IMPORTANT: Read this from event.secrets |
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
#!/usr/bin/env node | |
/* | |
* Install dependencies with: | |
* npm install request request-promise-native bottleneck | |
* | |
* Replace YOUR_TENANT_NAME, MGMT_TOKEN, and FILENAME | |
* The input file (FILENAME) should contain a list of user ids to delete, separated by newlines | |
*/ |
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
// an example to create a new mapping `ctrl-y` | |
mapkey('<Ctrl-y>', 'Show me the money', function() { | |
Normal.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
}); | |
// Map disabling surfing keys hotkey | |
map('<Ctrl-i>', '<Alt-s>'); | |
// Free up Alt-s for jetzt's use | |
unmap('<Alt-s>'); |
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
#!/bin/bash | |
SN="tmuxwork" | |
tmux has-session -t $SN &>/dev/null | |
if [ $? != 0 ] | |
then | |
tmux new -s $SN -n conf -d | |
tmux new-window -t $SN:2 -n misc |
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
Uses https://www.npmjs.com/package/@thream/socketio-jwt | |
Template based on the chat example at: https://socket.io/get-started/chat | |
Run with: | |
``` | |
node index.js | |
``` | |
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
exports.onExecutePostLogin = async (event, api) => { | |
2 const axios = require('axios') | |
3 const namespace = 'https://example.com' | |
4 | |
5 try { | |
6 const res = await axios.get('https://api.kanye.rest/') | |
7 api.idToken.setCustomClaim(`${namespace}/quote`, res.data.quote) | |
8 } catch (e) { | |
9 console.log('Error calling the API') | |
10 } |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.20/auth0-spa-js.production.js"></script> | |
<title>MFA API Test</title> | |
<style> | |
.hidden { display: none; } |
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 xpath = require('xpath') | |
const dom = require('xmldom').DOMParser | |
const crypto = require('crypto') | |
const fs = require('fs') | |
const calcThumbprint = function (cert) { | |
const shasum = crypto.createHash('sha1') | |
const der = new Buffer(cert, 'base64').toString('binary') | |
shasum.update(der, 'binary') | |
return shasum.digest('hex') |
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
[ | |
{ | |
"email": "thameera@example.com", | |
"email_verified": false, | |
"custom_password_hash": { | |
"algorithm": "sha256", | |
"hash": { | |
"value": "7054f76f832d2d4e244f73b3f3f4c3702cb60a573ed12441c90f159df560fcb5", | |
"encoding": "hex" | |
}, |
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
import { Injectable } from '@angular/core'; | |
import { AuthService } from '@auth0/auth0-angular'; | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class AudioService { | |
isAuthenticated = false |
NewerOlder