Skip to content

Instantly share code, notes, and snippets.

{
"info": {
"name": "Roles and Permissions Mgmgt API v2",
"_postman_id": "2073276d-fae4-6190-6158-5aa87d79fd80",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Roles",
"request": {
@pushpabrol
pushpabrol / update-custom-login-page-for-client
Last active July 13, 2017 15:21
Script to update the custom hosted login page per client in Auth0
var fs = require('fs');
var file = fs.readFileSync('path to file containing custom hosted login page', "utf8");
var client_id = '<client_id_of_app>';
var client_data = {};
client_data.custom_login_page = file;
client_data.custom_login_page_preview = file;
var tools = require('auth0-extension-tools');
tools.managementApi.getClient({
@pushpabrol
pushpabrol / gist:c9290784a3954691f3ca0b9e43407e78
Last active July 8, 2016 18:07
List and delete refresh_tokens
var request = require("request");
//1. get the user_id of the user
var user_id = '<user_id>'
//Use the client id and secret of your app registered with Auth0 from the management console
var client_id='<client_id>';
var client_secret = '<client_secret>';
var tenant_domain = 'tenant.auth0.com'; //sample - this is your tenant domain
//2. User your clientid and secret to get an access token for making the API calls -> This token lasts for 24 hrs so you should store it as opposed to getting a new 1 each time. For sample I am getting a new token each time.
@pushpabrol
pushpabrol / Option1.js
Created June 29, 2016 14:53
How to use ldapjs within a custom database connection in Auth0
function login(email, password, callback) {
var ldap = require('ldapjs');
if (!global.ldapClient) {
// console.log('Global Client not found');
var client = ldap.createClient({
url: 'ldap://server:389',
idleTimeout: 30000
});
client.bind('uid=admin,ou=system', 'secret', function(err) {