Skip to content

Instantly share code, notes, and snippets.

View woloski's full-sized avatar

Matias Woloski woloski

View GitHub Profile

Hey {user || there},

For the last few months, we've been working on many new features and improvements to the platform. We thought it was a good time to re-connect and give you a quick update about Auth0.

We have reached 1300+ subscribers to our service, and there are many companies using the private cloud/on-premises appliance daily. Thanks for your support, feedback and business!

Here are some of the things we thought you might find useful:

  1. Know who is using your apps
  2. Richer user profiles
@woloski
woloski / preuserhook.js
Created March 29, 2019 13:35
Pre User Registration hook for Auth0 that block disposable emails
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;
@woloski
woloski / contest-webtask.js
Created November 20, 2016 00:55
Contest Signup Webtask
'use latest';
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
const app = express();
var jwt = require('express-jwt');
var jwtCheck = jwt({
@woloski
woloski / blog.md
Created September 25, 2016 23:44
webtask editor

Introducing Webtask Editor

The Webtask Editor is a web based editor (and soon an Electron desktop app) to create and edit webtasks. This started as a side project but it quickly became clear that the editor would help adopt the serverless concept webtask Our goal is to reduce the time it takes to go from an idea => code => HTTPS endpoint.

The Power of WYSWYG

One of the tools many of us enjoyed using a lot in the old days was the SQL Explorer. The instant feedback you've got when executing queries was great. Edit your query, CTRL+R, see the result, teak the query, CTRL+R, and repeat that loop until you got it right.

@woloski
woloski / clientcreds.md
Last active September 1, 2016 18:54
Client Credentials Rules in Auth0

This is preliminary feature to add rules into the Client Credentials exchange pipeline (i.e. exchange a client_id and secret for an access_token).

To create a rule that runs on the client credentials exchange you have to use the webtask CLI (wt). To install the CLI, you can follow the steps here: https://manage.auth0.com/#/account/webtasks.

Assuming you have an API defined with scopes (https://manage.auth0.com/#/apis) and you created a non-interactive client (https://manage.auth0.com/#/applications) and authorized it to use that API, follow these steps to create a rule.

Currenlt you can create only one rule that will be executed for all clients and APIs.

  1. The first step is to create the webtask rule. Create a file myrule.js and enter the following. This is an example rule that will add an arbitrary claim (https://foo.com/claim) to the access_token and will also add an extra scope to the default scopes configured on the API (https://
@woloski
woloski / readme.md
Created August 29, 2016 18:16
functions registry

Public Functions

I will create a hello world function:

echo "module.exports = function(ctx, cb) { cb(null, 'hello'); }" > hello.js
wt create hello.js
@woloski
woloski / slack-auth0.md
Last active August 7, 2019 15:16
Slack + Auth0
  1. Install the Custom Social Connections extension
  2. Click on the Slack button to install the Slack connection
  3. Enter a Slack Client ID and Secret. To get those go to: https://api.slack.com/apps/new. Fill the fields and pay special attention to the Redirect URI. Enter: https://YOURS.auth0.com/login/callback. See screenshots below.
  4. Click on App Credentials on the left and copy the Client ID and Client Secret and paste them on the Auth0 dashboard
  5. Click Save and then try the flow using the Try button. You should get back the full profile from Slack, including email, team and avatars.

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:

@woloski
woloski / payment.html
Last active October 1, 2020 15:46
Stripe Checkout + webtask
<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);
@woloski
woloski / runscope vs node.md
Last active October 3, 2015 22:48
Runscope vs Node+Mocha

This is a comparison of two testing approaches: Runscope service and pure Node.js coding. Written by Hernan Meydac Jean (@VerlicRedclaw)

Runscope

This service provides a simple to use editor to create API tests with no effort.

Pros

  • Nice postman-like editor to create API tests.
  • Lots of configurable options, initial variables, shared settings, conditionals, etc.
  • Uses Chai.js as the Assertion library for responses
@woloski
woloski / webtask-auth0.md
Last active September 13, 2016 11:00
webtask + auth0
wt create webtask.js --auth0

When browsing the webtask URL, the user will get a page with Lock. Once logged in, the result of the webtask will be shown.