This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
// Replace with your applications client ID | |
var samlIdpClientId = 'YkERwRMChyzRGV2FRqrGK1NkiKEDi4kU'; | |
// only for a specific client | |
if (context.clientID !== samlIdpClientId) { | |
return callback(null, user, context); | |
} | |
// Custom certificate for SAML response signing when Auth0 is the IdP | |
context.samlConfiguration.cert = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if application.name != "MY APP NAME" %} | |
Reset link {{url}} | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if user.user_metadata.lang %} | |
<br> {{user.user_metadata.lang}} | |
{% elsif user.app_metadata.lang %} | |
<br> {{user.app_metadata.lang}} | |
{% else %} | |
<br> no metadata for the language | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
user.user_metadata = user.user_metadata || {}; | |
user.app_metadata = user.app_metadata || {}; | |
// persist the user_metadata and app_metadata again | |
auth0.users.updateUserMetadata(user.user_id, user.user_metadata) | |
.then(auth0.users.updateAppMetadata(user.user_id, user.app_metadata)) | |
.then(function(){ | |
callback(null, user, context); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Facebook Login JavaScript Example</title> | |
<meta charset="UTF-8"> | |
<script> | |
// This is called with the results from from FB.getLoginStatus(). | |
function statusChangeCallback(response) { | |
// The response object is returned with a status field that lets the app know the current login status of the person. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(accessToken, ctx, cb) { | |
// call oauth2 APIwith the accesstoken and create the profile | |
request.get('https://api.linkedin.com/v1/people/~', { | |
headers: { | |
'Connection': 'Keep-Alive', | |
'Authorization': 'Bearer ' + accessToken, | |
'x-li-format': 'json' | |
}, | |
}, function(e, r, b) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
// Set the client ID for the delegated admin extension in the below line if you wish | |
// and enable the if conditional | |
//if (context.clientID === 'DELEGATED_ADMIN_EXTENSION_CLIENT_ID') { | |
console.log("Insert the claim for the delegated admin extension"); | |
const namespace = 'https://example.com/auth0-delegated-admin'; | |
context.idToken[namespace] = { roles: [ 'Delegated Admin - Administrator' ] }; | |
return callback(null, user, context); | |
//} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ( user, context, callback ) { | |
// Only execute for Facebook Logins | |
if ( context.connectionStrategy !== 'facebook' ) | |
return callback( null, user, context ); | |
// If User hasn't granted email permissions | |
if ( typeof user.email === 'undefined' ) { | |
// Load auth0 Management SDK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://collectivegarbage.azurewebsites.net/use-thinktecture-identity-server-v2-to-authenticate-your-node-application/ | |
var express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
cookieParser = require('cookie-parser'), | |
session = require('express-session'), | |
passport = require('passport'), | |
wsfedsaml2 = require('passport-wsfed-saml2').Strategy; | |