Skip to main content

User Management with Auth0

Tonight I wanted to write about my current journey with moving our user identity management provider (which shall rename nameless), over to Auth0.  I would like to talk about the pitfalls and triumphs as we go.  It's mostly all good - a shame we hadn't done so sooner!

Now one of the most attractive attributes is the different methods/connectors that are provided in order to easily integrate your existing system, and I mean they cover just about everything, but this is also a segway to my first - very little - bit of criticism.  From what I see there are two main channels to provide some type of form to present to your user to input their credentials.  By the way, I'm still learning so please feel free to say I'm wrong at any stage.
  1. Lock / Universal Login 
  2. Hosted Pages
There is a mention of a "custom" way to work with Lock, but the customization looks little to be desired.  As to the hosted pages, well, again - correct me if I'm wrong - but it looks like the form being hosted has to contain the whole DOM, and if I'm going to make changes to my site's general template, I don't want to have to come back in here and do separate alterations.

I should also give a quick callout for the plugin they have developed for WordPress: Login by Auth0.  I've done some intial testing, and it works very well, and with all the functionality WordPress gives you, I understand you would just need to use its existing methods to login and create forms around.  Maybe it's just a bad name, but this got me to thinking how I would effectively create users as well using it.

But I digress, for me, I just want to tap in to the API's directly and build the form myself in our own environment - so for our migration, I am using the JS SDK (v9).  I've overcome a few hurdles, one of the most confusing aspects is the cross terminology from one type of API call to another.

For instance, take this example from this documentation, covering the use of the userinfo API. After the user has signed in, and they are given an access code, this is the same code you would use in place of the header: Authorization: Bearer {ACCESS_TOKEN}.

However, don't let this confuse you with that if you wanted to do something like a "user search", or "link accounts" etc.  This is done with the Auth0 Mangement API.  You'll also notice that unlike API's such as userinfo, where the URL is structured like: https://YOUR_DOMAIN/userinfo, the management API uses the format of https://YOUR_DOMAIN/api/v2/....

This management API uses a separate retrieval of an access token, which you can follow this guide on how to retrieve it.

Hopefully this has given some extra food for thought, and I'm sure this won't be the last I write on this subject. Nitty-picking at things aside, I'm very excited our team has collectively decided to use this platform.  It's tailored directly for devs!

Comments

Popular posts from this blog

question2answer Wordpress Integration

 Today I want to journal my implementation of a WordPress site with the package of "question2answer".  It comes as self-promoted as being able to integrate with WordPress "out of the box".  I'm going to vent a small amount of frustration here, because the only integration going on is the simplicity of configuration with using the same database, along with the user authentication of WordPress.  Otherwise they run as two separate sites/themes. This will not do. So let's get to some context.  I have a new hobby project in mind which requires a open source stack-overflow clone.  Enter question2answer .  Now I don't want to come across as completely ungrateful, this package - while old, ticks all the boxes and looks like it was well maintained, but I need every  page to look the same to have a seamless integration.  So, let's go through this step by step. Forum Index Update This step probably  doesn't need to be done, but I just wanted to mak...

Running NodeJS Serverless Locally

 So it's been a long time, but I thought this was a neat little trick so I thought I'd share it with the world - as little followers as I have.  In my spare time I've been writing up a new hobby project in Serverless , and while I do maintain a staging and production environment in AWS, it means I need to do a deployment every time I want to test all of the API's I've drafted for it. Not wanting to disturb the yaml configuration for running it locally, I've come up with a simple outline of a server which continues to use the same configuration.  Take the express driven server I first define here: And then put a index.js  in your routes folder to contain this code: Voila! This will take the request from your localhost and interpret the path against your serverless.yml and run the configured function.  Hope this helps someone!

Google Sheets Web App

 Greetings! Has been yet another long period since my last post, but hopefully the type of content makes up for it.  Today I'm writing about a need that I had to document my entire movie collection in Google Sheets, because some that were on my local network, some on DVD, some on my Playstation Video account and as well as my small collection in Google TV.  All in all there is currently over 500 movies, and growing. So the spreadsheet is fine on its own, but something nice and "pretty" was needed to list, search and filter by the movie's attributes.  I first got an API key to be used with  OMDB API .  This allows me to get a JSON of the movie's IMDB attributes with a search from the title.  I then added two functions in the "Apps Script" component of the sheet: From here, I could call the function to search (from a cell) with: =API(CONCAT("http://www.omdbapi.com/?apikey=*******&t=",ENCODEURL(A1))) That would return the JSON (assuming A1 is...