Skip to content

Instantly share code, notes, and snippets.

View saltukalakus's full-sized avatar
💭

Saltuk Alakus saltukalakus

💭
View GitHub Profile
@saltukalakus
saltukalakus / caution-account-auto-link-rule.js
Created February 13, 2023 20:18 — forked from jatinvaidya/caution-account-auto-link-rule.js
CAUTION: Automatically Link Accounts with Verified Email
@saltukalakus
saltukalakus / handler.js
Created September 7, 2020 14:19 — forked from marc-barry/handler.js
Cloudflare Worker for Auth0 Self-Managed Certificates
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,
@saltukalakus
saltukalakus / README.md
Created April 9, 2019 23:16 — forked from sandrinodimattia/README.md
Upload custom signing certificate in Auth0 Generic SAML-P Connection

Upload custom signing certificate in Auth0 Generic SAML-P Connection

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:

@saltukalakus
saltukalakus / ws-fed-auth0.js
Created November 22, 2018 15:23 — forked from nzpcmad/ws-fed-auth0.js
Node.js with Express SSL, WS-Fed and ADFS
// 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>
@saltukalakus
saltukalakus / gist:1b3c4815a1bad7da51b98a38446dbab6
Created March 24, 2017 00:18 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@saltukalakus
saltukalakus / gist:a11ef96fbad46c46516dc2ddf1d42da5
Created March 24, 2017 00:18 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@saltukalakus
saltukalakus / unfollow.py
Created January 15, 2017 01:23 — forked from perpetual-hydrofoil/unfollow.py
Twitter Unfollow Example (python)
#! /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
#
@saltukalakus
saltukalakus / delete_all_tweets.py
Created January 15, 2017 01:22 — forked from vik-y/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- 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.