Skip to content

Commit

Permalink
Plugin skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
alexashley committed Feb 4, 2019
1 parent 2c00d47 commit f0b0a2b
Show file tree
Hide file tree
Showing 5 changed files with 529 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
save-exact = true
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
10
14 changes: 14 additions & 0 deletions package.json
@@ -0,0 +1,14 @@
{
"name": "insomnia-plugin-openid-connect",
"version": "0.0.0",
"description": "An Insomnia plugin for authenticating with OpenId Connect",
"main": "plugin.js",
"repository": "git@github.com:alexashley/insomnia-plugin-openid-connect.git",
"author": "Alex Ashley <alexashley15@gmail.com>",
"license": "MIT",
"private": false,
"dependencies": {
"joi": "14.3.1",
"openid-client": "2.4.5"
}
}
14 changes: 14 additions & 0 deletions plugin,js
@@ -0,0 +1,14 @@
const oidc = require('openid-client');
const joi = require('joi');

const schema = joi.object().keys({
clientId: joi.string().required(),
// allow the clientSecret to be an empty string for public clients (e.g., mobile apps)
// that said, it's not recommended for public clients to use direct access grants or the client credentials flow
clientSecret: joi.string().allow('').required(),
grantType: joi.string().valid('password', 'client_credentials').default('password').required(),
username: joi.string().required(), // TODO: only require username/password for direct access/resource owner credentials
password: joi.string().required()
});

module.exports.templateTags = [];

0 comments on commit f0b0a2b

Please sign in to comment.