Skip to content

Instantly share code, notes, and snippets.

View nicosabena's full-sized avatar

Nico Sabena nicosabena

  • Auth0, Inc.
  • Seattle greater area, WA
View GitHub Profile
@nicosabena
nicosabena / embedded-lock-test.html
Created October 29, 2020 22:24
embedded-lock-test.html
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<TITLE>
Hello World
</TITLE>
<style>
@nicosabena
nicosabena / smaller-header-hlp.html
Created November 6, 2020 23:19
Decrease Lock's header for mobile devices in HLP
<!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, maximum-scale=1, user-scalable=0" />
<style type="text/css">
/* completely hide the header
@nicosabena
nicosabena / Configure WS-Fed generated attributes.js
Last active December 4, 2020 17:08
Rule to configure claims for the WS-Fed Add on token generated by Auth0
function (user, context, callback) {
// only apply changes for the WS-Fed application
if (context.clientName !== 'Your ws-fed application name') {
return callback(null, user, context);
}
// exclude the upn claim creation (defaults to true)
context.samlConfiguration.createUpnClaim = false;
@nicosabena
nicosabena / force_single_connection_no_ui.html
Created December 2, 2023 00:01
Auth0 "classic" hosted login page that takes the user to a specific connection to authenticate
<!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>
@nicosabena
nicosabena / post_login_action.js
Created April 14, 2025 23:08
Auth0 action to prevent users from logging in the first time with the same email address as an existing user
const { ManagementClient } = require("auth0");
exports.onExecutePostLogin = async (event, api) => {
const INITIAL_LOGIN_CHECK = "initial_login_check"
const initialLoginCheck = event.user.app_metadata[INITIAL_LOGIN_CHECK];
if (initialLoginCheck) {
// We already checked for duplicate emails, no further work
// to be done in this Action.
return;
@nicosabena
nicosabena / index.html
Created December 17, 2025 00:04
How to request an MFA API from the browser using auth0-spa-js v2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://cdn.auth0.com/js/auth0-spa-js/2.11/auth0-spa-js.production.js"></script>
<title>MFA API Test</title>
<style>