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:
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); | |
}) |
{% 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 %} |
{% if application.name != "MY APP NAME" %} | |
Reset link {{url}} | |
{% endif %} |
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 = |
-----BEGIN CERTIFICATE----- | |
MIIDVDCCAjwCCQD/IaNvZiZwXTANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJV | |
UzELMAkGA1UECAwCTkExCzAJBgNVBAcMAk5BMQswCQYDVQQKDAJOQTELMAkGA1UE | |
CwwCTkExCzAJBgNVBAMMAk5BMRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29t | |
MB4XDTE5MDMxODIzMTg1MFoXDTI5MDMxNTIzMTg1MFowbDELMAkGA1UEBhMCVVMx | |
CzAJBgNVBAgMAk5BMQswCQYDVQQHDAJOQTELMAkGA1UECgwCTkExCzAJBgNVBAsM | |
Ak5BMQswCQYDVQQDDAJOQTEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTCC | |
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPFP465zqXNLhHmAcQpLKg/s | |
TqMypLhHyr0erwiyMeaF9qybXqr+yuZsnjNDVtSPsU9Io2Z58dpKRscFtCeEF0qb | |
C3QDIhW3taZxEW6t6+2PEM0Hp0SqpyNH5ugEaEi+ojS18EKuwPp67Cer8mDUyhjx |
module.exports = function (user, context, cb) { | |
var response = {}; | |
response.user = user; | |
// Add user or app metadata to the newly created user | |
response.user = { | |
user_metadata: { foo: 'bar' }, | |
app_metadata: { vip: true, score: 7 } | |
}; |
<!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> |
/* | |
* Update a Mailchimp list with user emails during the signup or the first login. | |
* | |
* Create the following atributes in the Auth0 RULE configuration settings. | |
* https://auth0.com/docs/rules/guides/configuration | |
* | |
* MC_TOKEN: Mailchimp API Token. E.g.: ef235a44355dda3e61ea074ae0d439a2-us20 | |
* MC_LIST_ID: ID of the Mailchimp list you would like to populate. E.g.: ca9eb2555e | |
* MC_API_URL: Mailchimp API URL. E.g.: https://us20.api.mailchimp.com/3.0 | |
* |
<!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> |