Skip to content

Instantly share code, notes, and snippets.

Saltuk Alakus saltukalakus

Block or report user

Report or block saltukalakus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@saltukalakus
saltukalakus / force_user_email_verification_rule.js
Last active Aug 29, 2019
Rule to force email verification only for some applications on the Auth0 dashboard
View force_user_email_verification_rule.js
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.'));
@saltukalakus
saltukalakus / sample_users_with_id.json
Created Aug 23, 2019
Sample users JSON file to import
View sample_users_with_id.json
[{"user_id":"583c3ac3f38e84297c002546","email":"test@test.com","name":"test@test.com","nickname":"test","last_ip":"94.121.163.63","logins_count":15,"created_at":"2016-11-28T14:10:11.338Z","updated_at":"2016-12-02T01:17:29.310Z","last_login":"2016-12-02T01:17:29.310Z","email_verified":true},
{"user_id":"583c5484cb79a5fe593425a9","email":"test1@test.com","name":"test1@test.com","nickname":"test1","last_ip":"94.121.168.53","logins_count":1,"created_at":"2016-11-28T16:00:04.209Z","updated_at":"2016-11-28T16:00:47.203Z","last_login":"2016-11-28T16:00:47.203Z","email_verified":true},
{"user_id":"583c57672c7686377d2f66c9","email":"aaa@aaa.com","name":"aaa@aaa.com","nickname":"aaa","last_ip":"94.121.168.53","logins_count":2,"created_at":"2016-11-28T16:12:23.777Z","updated_at":"2016-11-28T16:12:52.353Z","last_login":"2016-11-28T16:12:52.353Z","email_verified":true},
{"user_id":"5840b954da0529cd293d76fe","email":"a@a.com","name":"a@a.com","nickname":"a","last_ip":"94.121.163.63","logins_count":3,"created_at":"2016-12-0
@saltukalakus
saltukalakus / hostedPage.html
Last active Aug 7, 2019
Lock validator function
View hostedPage.html
<!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 / silent.js
Created Jul 19, 2019
Check is the user is already authenticated on other site.
View silent.js
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 / hosted_email_verification.html
Last active May 2, 2019
A workaround to check the user email verification state for the Auth0 DB on the hosted page
View hosted_email_verification.html
<!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 / group_filter_rule.js
Created Apr 24, 2019
Insert the groups which starts with a case insensitive keyword into the ID token with an Auth0 rule
View group_filter_rule.js
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 / PasswordlessLock.html
Last active Apr 18, 2019
A workaround to configure Passwordless Lock with an enterprise connection.
View PasswordlessLock.html
<!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 / hosted_lock.html
Created Apr 15, 2019
Show signup tab focused.
View hosted_lock.html
<!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 / auth0_hosted.html
Created Apr 10, 2019
Map language for Lock with fallback to English
View auth0_hosted.html
<!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 / README.md
Created Apr 9, 2019 — forked from sandrinodimattia/README.md
Upload custom signing certificate in Auth0 Generic SAML-P Connection
View README.md

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:

You can’t perform that action at this time.