Skip to content

Instantly share code, notes, and snippets.

@iamkirkbater
Created May 19, 2017 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamkirkbater/a298273ec6e96e2eff3b314d1ec0a49c to your computer and use it in GitHub Desktop.
Save iamkirkbater/a298273ec6e96e2eff3b314d1ec0a49c to your computer and use it in GitHub Desktop.
Github SSO To Name Extension Instructions

Hi,

Thanks for using my Github SSO to Name Chrome Extension. This gist is to help you get all set up.

First off, I want to address any complaints that the extension asks permission to ALL web pages. This is due to the fact that the extension asks you to fill in your specific enterprise URL, and then only runs the code on pages with that URL. We don't use the browser functionality for that because otherwise we'd need to know your enterprise URL, and I'm not putting that into code. Sorry. Please feel free to check out the code, it shouldn't be doing anything shady.

Configuration

To configure the extension, either navigate to chrome://extensions and then find the extension, or click on the icon next to your location bar, and then click on Options. This should give you a page with three options to configure.

The first option is going to be the URL to match against when deciding whether or not to run the code. This matches based on indexOf in javascript, so as long as it's not -1 it's going to match, so be as specific as you want to be. This may or may not be optimized in future versions, if it's causing enough people pain I might look into it. Some examples would be:

The next field is the API url for your Github Enterprise server. This will usually look something like https://github.myenterprise.com/api/v3. Be sure to leave off the trailing slash. This is where we send our requests to get the information for each username that needs to be mapped to a name.

The last field is the pattern to match against. I figured not all of the enterprises in the world have the same SSO Login pattern configuration, and so I figured I'd leave it up to a regular expression to be able to parse against. This could cause some collisions, so it might not always work properly, depending on what the regular expression is. For example, if your company's SSO login would be something like 3456789 you would put something like \d{7} in the field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment