Skip to content

Instantly share code, notes, and snippets.

View sandrinodimattia's full-sized avatar
🏠
Working from home

Sandrino Di Mattia sandrinodimattia

🏠
Working from home
View GitHub Profile
@sandrinodimattia
sandrinodimattia / gist:3162314
Created July 23, 2012 06:46
Dynamics CRM 2011 eID Javascript
<html>
<head>
<title>eID: Read</title>
<script type="text/javascript" src="https://localhost:100/be_belgium_eid.js"></script>
<script language="javascript" type="text/javascript">
// Initialize the reader.
var cardReader = new be.belgium.eid.CardReader();
// Bind error events.
function noCardPresentHandler() { window.alert("No card present!"); }
@sandrinodimattia
sandrinodimattia / install-authorization-extension-beta.md
Last active November 17, 2016 19:31
Installing the Authorization Extension Beta

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 September 20, 2016 22:01
Extensions Development

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 August 4, 2016 09:36
Promises and Node version in Auth0 Rules
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);
});
}
"use latest";
const howMany = function(cb) {
var options = {
url: 'https://auth0.com/about',
qs: {
'_escaped_fragment_': ''
},
headers: {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'
param
(
[string]$ServiceName,
[string]$VmName,
[string]$UserName,
[string]$Password
)
$ErrorActionPreference = "Stop"
@sandrinodimattia
sandrinodimattia / README.md
Last active June 28, 2016 14:55
Auth0 Source Control Integration with GitHub

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 / advanced-hrd.html
Created May 18, 2016 07:51
Advanced HRD on the Login 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, maximum-scale=1.0, user-scalable=no" />
<style>
html, body { padding: 0; margin: 0; }
@sandrinodimattia
sandrinodimattia / hrd.html
Created May 16, 2016 03:49
Auth0 Lock - Custom HRD
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
// Decode utf8 characters properly
var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
var connection = config.connection;
var prompt = config.prompt;
var initializationOptions = {
assetsUrl: config.assetsUrl,
@sandrinodimattia
sandrinodimattia / README.md
Last active February 29, 2016 16:07
Troubleshooting websocket connections in the Auth0 AD/LDAP Connector

This little script will test if you are able to connect to the AD/LDAP Connector endpoint with Websockets.

To run this:

  1. Save the file troubleshootws.js in your AD/LDAP Connector folder.
  2. Run: node troubleshootws