Get or generate a new signing certificate:
openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout saml.key -out saml.crt
Update the script and update the following settings:
// auto linking of accounts is NOT OK in most circumstances. | |
// "user-initiated" or "prompted" account linking must be preferred. | |
// https://auth0.com/docs/users/user-account-linking#scenarios | |
function (user, context, callback) { | |
console.log(`account-link rule called ${user.user_id}`); | |
const request = require('request'); | |
// Check if email is verified, we shouldn't automatically merge accounts if this is not the case. | |
// Also, the requirement is to link a currently authenticating Enterprise (federated) Account with | |
// an existing Auth0 Database Account, so thats the only combination we are allowing. | |
if (!user.email || !user.email_verified || user.identities[0].provider === 'auth0') { |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const url = new URL(request.url) | |
url.hostname = 'SOME_HOSTNAME' // i.e. 'dev-w-47n-vy-cd-e88kLg26GFbLGgBI.edge.tenants.auth0.com' | |
request = new Request(request) | |
request.headers.set('cname-api-key', 'SOME_KEY') // i.e. 'd4f2f3ef5a3ee3af4846127281d3450628bdc16d63e802dea75878fe9a63a279' | |
async function getTokenFromRulesConfig(user, context, callback) { | |
const m2mClientID = configuration.m2mCID; | |
const m2mClientSecret = configuration.m2mCSecret; | |
let auth0Domain = '<<your_tenant>>.auth0.com'; | |
const moment = require('moment-timezone'); | |
let axios = require('axios'); | |
const country = context.request.geoip.country_name; | |
const data = { | |
user_app_metadata: user.app_metadata, | |
email: user.email, |
// http://collectivegarbage.azurewebsites.net/use-thinktecture-identity-server-v2-to-authenticate-your-node-application/ | |
var express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
cookieParser = require('cookie-parser'), | |
session = require('express-session'), | |
passport = require('passport'), | |
wsfedsaml2 = require('passport-wsfed-saml2').Strategy; | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Sign In with Auth0</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
</head> |
#! /usr/bin/env python | |
# how to unfollow everyone who isn't following you | |
# By Jamieson Becker (Public Domain/no copyright, do what you will) | |
# Easy instructions, even if you don't know Python | |
# | |
# 1. Install pip (apt-get install python-pip) and then | |
# pip install tweepy, which is the python twitter client | |
# |
# -*- coding: utf-8 -*- | |
""" | |
This script is forked originally from Dave Jeffery. The original implementation | |
was very slow and deleted around 2 tweets per second. Making it multithreaded I | |
am able to delete 30-50 tweets per second. | |
@author: vik-y | |
---------------------------------------------------------------------------- | |
This script will delete all of the tweets in the specified account. |