Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Created October 10, 2018 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcanhelp/f7ac2cf923ab7a10e759a5d0daa8e032 to your computer and use it in GitHub Desktop.
Save joshcanhelp/f7ac2cf923ab7a10e759a5d0daa8e032 to your computer and use it in GitHub Desktop.
Sample get connection response
{
"id": "[REDACTED]",
"options": {
"mfa": {
"active": true,
"return_enroll_settings": true
},
"passwordPolicy": "[REDACTED]",
"enabledDatabaseCustomization": true,
"requires_username": true,
"import_mode": true,
"brute_force_protection": true,
"validation": {
"username": {
"min": 1,
"max": 100
}
},
"customScripts": {
"login": "\nfunction login (email, password, callback) {\n console.log(email);\n\n var request = require(\"request\");\n\n request.post(\n \"[REDACTED]\", \n {\n form: {\n username:email, \n password:password, \n access_token:\"[REDACTED]\"\n },\n }, function(error, response, body){\n \n console.log(email);\n console.log(password);\n \n if ( error ) {\n return callback(error);\n }\n\n var info = JSON.parse(body);\n\n if (info.error) {\n console.log(info);\n callback();\n } else {\n var profile = {\n user_id: info.data.ID,\n username: info.data.user_login,\n email_verified: true,\n email: info.data.user_email,\n name: info.data.display_name\n };\n\n callback(null, profile);\n }\n\n });\n}\n",
"get_user": "\nfunction getByEmail (email, callback) {\n\n var request = require(\"request\");\n\n request.post(\"https://auth0.joshcanhelp.com/index.php?a0_action=migration-ws-get-user\", {\n form:{username:email, access_token:\"[REDACTED]\"},\n }, function(error, response, body){\n\n if ( error ) {\n return callback(error);\n }\n\n var info = JSON.parse(body);\n\n if (info.error) {\n callback(null);\n } else {\n var profile = {\n user_id: info.data.ID,\n username: info.data.user_login,\n email: info.data.user_email,\n name: info.data.display_name,\n email_verified: true\n };\n\n callback(null, profile);\n }\n\n });\n}\n"
},
"strategy_version": 2
},
"strategy": "auth0",
"name": "[REDACTED]",
"is_domain_connection": false,
"enabled_clients": [
"[REDACTED]",
"[REDACTED]",
"[REDACTED]"
],
"realms": [
"[REDACTED]"
],
"metadata": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment