Skip to content

Instantly share code, notes, and snippets.

View ShadSterling's full-sized avatar

Shad Sterling ShadSterling

  • Atlanta, GA, U.S.A.
View GitHub Profile
@ShadSterling
ShadSterling / password-generator
Created February 21, 2023 04:40
password-generator
#!/usr/bin/env php
<?php
function dev_rand( $min=0, $max=-1 )
{
if( -1 == $max ) { $max=getrandmax(); } #can't use a function as a default value
$range = $max-$min+1; #+1 to be inclusive
$file="/dev/random"; ##urandom is the faster/less random variant
$handle=fopen($file,"rb");
if( false == $handle ) { throw new Exception("Unable to open ".$file); }
@ShadSterling
ShadSterling / npm-debug.log
Created May 17, 2018 13:49
`npm audit` fails on a package with a single dependency on NPM 6
0 info it worked if it ends with ok
1 verbose cli [ '/opt/local/bin/node', '/opt/local/bin/npm', 'run', 'audit' ]
2 info using npm@5.8.0
3 info using node@v8.11.2
4 verbose run-script [ 'preaudit', 'audit', 'postaudit' ]
5 info lifecycle npm-issue@1.0.0~preaudit: npm-issue@1.0.0
6 info lifecycle npm-issue@1.0.0~audit: npm-issue@1.0.0
7 verbose lifecycle npm-issue@1.0.0~audit: unsafe-perm in lifecycle true
8 verbose lifecycle npm-issue@1.0.0~audit: PATH: /opt/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ssterling3/Documents/2018/IIT/Repos/npm-issue/node_modules/.bin:/Users/ssterling3/bin/mac:/Users/ssterling3/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/gnubin/:/Users/ssterling3/.npm-global/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/local/munki:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ssterling3/bin/mac:/Users/ssterling3/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/gnubin/:/Users/ssterlin
@ShadSterling
ShadSterling / oidc-client-js-docs-start.md
Created May 3, 2018 00:29
oidc-client-js-docs-start

I'm doing everything in TypeScript, so there may be some differences in usage from pure JavaScript.

I'm not using this repository directly, I'm using a fork that was made for the app before it was handed to me, and modified to be compatible with a GLUU server: https://github.com/gastate/oidc-client-js

Basics

All signin methods require at least these two steps:

  1. Make the browser load a URL on the authentication server
  2. Handle the redirect when the authentication server navigates the browser back to your redirect handler