Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sandrino Di Mattia sandrinodimattia

🏠
Working from home
View GitHub Profile
@sandrinodimattia
sandrinodimattia / generate-certs.js
Created Jan 29, 2018
Generate self signed certificates with the selfsigned library and validate those with OpenSSL 1.1
View generate-certs.js
const fs = require('fs');
const ursa = require('ursa');
const async = require('async');
const faker = require('faker');
const util = require('util');
const spawn = require('child_process').spawn;
const selfsigned = require('selfsigned');
const total = Array.from(Array(10000).keys());
@sandrinodimattia
sandrinodimattia / README.md
Last active May 2, 2019
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:

@sandrinodimattia
sandrinodimattia / auth0-with-azure-b2c.md
Last active May 19, 2018
Connect Auth0 with Azure B2C
View auth0-with-azure-b2c.md

Connect Auth0 with Azure AD B2C

Configuration

  1. Create an Azure AD B2C Directory
  2. Create a Regular Web Application (set the url here to https://YOUR_AUTH0_ACCOUNT/login/callback)
  3. Create a key
  4. Take note of the Application ID and the Key
  5. Create a sign in policy (you will have a name like B2C_1_signing)
@sandrinodimattia
sandrinodimattia / install-authorization-extension-beta.md
Last active Nov 17, 2016
Installing the Authorization Extension Beta
View install-authorization-extension-beta.md

This document explains how you can test the new authorization extension in a US account. Keep into account that, once available in the Extension Gallery, all these steps will not be required.

Configure Webtask

Go to this page and follow the steps to connect to your webtask account: https://manage.auth0.com/#/account/webtasks

Configure your Auth0 Account

Start by creating a new client: https://manage.auth0.com/#/clients

@sandrinodimattia
sandrinodimattia / README.md
Last active Sep 20, 2016
Extensions Development
View README.md

Finding your extensions

  1. Go to https://manage.auth0.com/#/extensions
  2. Copy the link of an installed extension
  3. Get the ID from the link (8d6f0f0711daedc87d1a6d595771015a)
https://sandbox.it.auth0.com/api/run/sandrino-dev/8d6f0f0711daedc87d1a6d595771015a?webtask_no_cache=1
@sandrinodimattia
sandrinodimattia / rule.js
Created Aug 4, 2016
Promises and Node version in Auth0 Rules
View rule.js
function (user, context, callback) {
var Promise = require('bluebird');
Promise.resolve('foo')
.then(function(result) {
console.log('Node version:', process.env.NODE_VERSION);
console.log('Promise result:', result);
callback(null, user, context);
});
}
@sandrinodimattia
sandrinodimattia / README.md
Last active Jun 28, 2016
Auth0 Source Control Integration with GitHub
View README.md

Auth0 Source Control Integration with GitHub

The Github Deploy extension allows you to deploy rules and database connections from GitHub to Auth0 (currently only for the public cloud as extensions are not yet supported in the appliance).

  • Repositories: public and private repos (using GitHub Personal Access Tokens)
  • Rules: Supports the actual code + status (enable/disabled), stage and order
  • Database Connections: all scripts

Everything is convention based and a sample repository is available here: https://github.com/auth0-samples/github-source-control-integration

@sandrinodimattia
sandrinodimattia / lock-switch-to-signup.html
Created May 31, 2016
Auth0 Lock example that shows how to switch to the Login page when a certain condition is met
View lock-switch-to-signup.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, maximum-scale=1.0, user-scalable=no" />
<style>
html, body { padding: 0; margin: 0; }
@sandrinodimattia
sandrinodimattia / automate-login-page-email-templates.md
Last active Apr 8, 2019
Automatic configuration of the Auth0 Login Page and Email Templates
View automate-login-page-email-templates.md

Customzing the Password Reset Page

Go to the API v2 explorer and generate a token with update:tenant_settings. Then call the tenants endpoint with the new HTML:

PATCH https://{YOUR_DOMAIN}/api/v2/tenants/settings

{
  "change_password": {
    "enabled": true,
@sandrinodimattia
sandrinodimattia / advanced-hrd.html
Created May 18, 2016
Advanced HRD on the Login Page
View advanced-hrd.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, maximum-scale=1.0, user-scalable=no" />
<style>
html, body { padding: 0; margin: 0; }
You can’t perform that action at this time.