@ist-group/playground-oidc-express
v0.0.11
Published
A library for hosting graphql playground with oidc login as express middleware.
Downloads
25
Readme
playground-oidc-express
A library for hosting graphql playground with oidc login as express middleware.
Installation
yarn add @ist-group/playground-oidc-client
Usage
import playground from "@ist-group/playground-oidc-express";
server.use(
"/playground",
playground({
endpoint: "/graphql",
auth: {
clientId: "community-portal",
scope: "openid profile community",
authority: "https://demo.skolid.se"
}
})
);
Playground is now accessable from <domain>/playground
.
Config
By default the authentication headers are only sent to the endpoint specified.
A list of regex (authHeaderFilters
) can be included to allow headers to other paths and/or domains.
authHeaderFilters: [
/^http:\/\/localhost:4010\/other_graphql$/,
/^https:\/\/example.com\/graphql$/
];
Other params:
acrValues?: string; // default undefined
automaticSilentRenew?: boolean; // default true
noAutomaticLogin?: boolean; // default false
IdP configuration
The URL:s / paths which this library uses:
- Redirect: <basePath>
- Post logout: <basePath>
- Silent renew: <basePath>/silent-renew.html
configuration example from code above:
- Redirect: http://localhost:4010/playground
- Post logout: http://localhost:4010/playground
- Silent renew: http://localhost:4010/playground/silent-renew.html
Note: trailing "/
" (slash) is removed