Una lib simple para enviar emails usando la API de Gmail con autenticación de Service Account.
- ✅ Envío de emails usando Gmail API
- ✅ Soporte para Domain-Wide Delegation
- ✅ Manejo robusto de errores
- ✅ Validación de formatos de email
| function (user, context, callback) { | |
| // | |
| // this rule can be used if you have chosen to use Username as the way to identify a user in Salesforce. Notice that we are mapping the email to the nameidentifier. | |
| // | |
| if (context.clientName === 'Salesforce') { | |
| context.samlConfiguration.mappings = { | |
| 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': 'email', | |
| 'User.Username': 'email', | |
| 'User.Email': 'email', | |
| 'User.FirstName': 'given_name', |
| const emailVerifier = require("verifier-node"); | |
| module.exports = function (user, context, cb) { | |
| var response = {}; | |
| emailVerifier.verify(user.email, context.webtask.secrets.VERIFIER_APIKEY) | |
| .then(response => { | |
| if (!response.valid()) return cb(new Error('Disposable email!')); | |
| response.user = user; |
| This would be the console output | |
| Claims for: https://myadfs/ (Correlation: 84b46102-3ed2-4ff2-88ac-eace0709667c) | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/organization : myadfs | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant : 2012-04-12T21:15:32.410Z | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod : http://schemas.microsoft.com/ws/20 | |
| enticationmethod/windows | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid : S-1-5-21-1409732942-2814574796-20323036 | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid : S-1-5-21-1409732942-2814574796-203230364-513 | |
| http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid : S-1-1-0 |
| <button class="pay">Pay</button> | |
| <script src="https://checkout.stripe.com/checkout.js"> | |
| <script> | |
| var handler = StripeCheckout.configure({ | |
| key: window.STRIPE_PUBLICK_KEY, | |
| image: 'https://yourlogo.png', | |
| locale: 'auto', | |
| token: function(token) { | |
| $('.pay').prop("disabled", true); |
Note: you can change the scopes on the Scope field on Auth0 and include any of these: https://api.slack.com/docs/oauth-scopes
You can now use the Slack connection using any Auth0 client library. Example:
| import webapp2 | |
| import urllib2 | |
| import urllib | |
| import json | |
| ## CHANGE THIS | |
| CLIENT_ID = "vYPeq7LGf1utg2dbDlGKCwGKgy94lPH0" | |
| CLIENT_SECRET = "DLQ5dWkNMwPlUWo2jqVkbG1PFyeMvV60HEJaW0FioeI4ZxGaAW73BiqRBZmRk29v" | |
| DOMAIN = "contoso.auth0.com" | |
| CALLBACK_URL = "http://localhost:8080/callback" |