Skip to content

Instantly share code, notes, and snippets.

View saltukalakus's full-sized avatar
🐢
Rust & Cryptography

saltukalakus

🐢
Rust & Cryptography
View GitHub Profile
@saltukalakus
saltukalakus / hosted_lock.html
Created April 15, 2019 16:50
Show signup tab focused.
<!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" />
</head>
<body>
@saltukalakus
saltukalakus / PasswordlessLock.html
Last active June 10, 2025 09:27
A workaround to configure Passwordless Lock with an enterprise connection.
<!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" />
</head>
<body>
@saltukalakus
saltukalakus / group_filter_rule.js
Created April 24, 2019 20:30
Insert the groups which starts with a case insensitive keyword into the ID token with an Auth0 rule
function (user, context, callback) {
const namespace = 'https://acme.com/';
const KEY_WORD = "ruler"; // Any groups which start with Ruler is inserted.
function selectGroups(group) {
return group.toLowerCase().indexOf(KEY_WORD) === 0;
}
context.idToken[namespace + 'groups'] = user.groups &&
user.groups.filter(selectGroups);
callback(null, user, context);
@saltukalakus
saltukalakus / hosted_email_verification.html
Last active June 2, 2025 20:36
A workaround to check the user email verification state for the Auth0 DB on the hosted page
<!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>
<style>
@saltukalakus
saltukalakus / silent.js
Created July 19, 2019 03:36
Check is the user is already authenticated on other site.
window.onload = function() {
webAuth = new auth0.WebAuth({
domain: 'saltuk-wordpress.auth0.com',
redirectUri: 'http://dev-auth0-test1.pantheonsite.io/index.php?auth0=1',
clientID: 'SCNHLB4vHvQlTKazudZO87LDikCyrP6s',
responseType: 'token id_token',
});
if (document.cookie.match(/^(.*;)?\s*CheckedSessionCookie\s*=\s*[^;]+(.*)?$/) === null) {
@saltukalakus
saltukalakus / hostedPage.html
Last active June 2, 2025 20:36
Lock validator function
<!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" />
</head>
<body>
@saltukalakus
saltukalakus / sample_users_with_id.json
Last active June 2, 2025 20:36
Sample users JSON file to import
[
{
"user_id": "583c3ac3f38e84297c002546",
"email": "[email protected]",
"name": "[email protected]",
"given_name": "Hello",
"family_name": "Test",
"nickname": "test",
"last_ip": "94.121.163.63",
"logins_count": 15,
@saltukalakus
saltukalakus / force_user_email_verification_rule.js
Last active June 2, 2025 20:36
Rule to force email verification only for some applications on the Auth0 dashboard
function (user, context, callback) {
// Bypass this rule for a particular app
if(context.clientName === 'NameOfTheAppToBypass'){
return callback(null, user, context);
}
// Access should only be granted to verified users otherwise.
if (!user.email || !user.email_verified) {
return callback(new UnauthorizedError('Access denied.'));
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">.ExternalClass,.ExternalClass div,.ExternalClass font,.ExternalClass p,.ExternalClass span,.ExternalClass td,img{line-height:100%}#outlook a{padding:0}.ExternalClass,.ReadMsgBody{width:100%}a,blockquote,body,li,p,table,td{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}table,td{mso-table-lspace:0;mso-table-rspace:0}img{-ms-interpolation-mode:bicubic;border:0;height:auto;outline:0;text-decoration:none}table{border-collapse:collapse!important}#bodyCell,#bodyTable,body{height:100%!important;margin:0;padding:0;font-family:ProximaNova,sans-serif}#bodyCell{padding:20px}#bodyTable{width:600px}@font-face{font-family:ProximaNova;src:url(https://cdn.auth0.com/fonts/proxima-nova/proximanova-regular-webfont-webfont.eot);src:url(https://cdn.auth
@saltukalakus
saltukalakus / welcome_sent.js
Created November 2, 2019 11:45
Welcome Sent message
function (user, context, callback) {
// If the connection isn't email passwordless return
if (context.connection !== "email") {
return callback(null, user, context);
}
if (user.app_metadata && user.app_metadata.welcomeSent) {
return callback(null, user, context);