In Grant v4 the id_token was returned decoded by default:
{
id_token: {header: {}, payload: {}, signature: '...'},
access_token: '...',
refresh_token: '...'
}In Grant v5 the id_token is returned as string instead:
{
id_token: 'abc.abc.abc',
access_token: '...',
refresh_token: '...'
}In Grant v4 the following response configuration:
{
"google": {
"response": ["jwt"]
}
}Was returning the decoded JWT as id_token_jwt:
{
id_token: '...',
access_token: '...',
refresh_token: '...',
id_token_jwt: {header: {}, payload: {}, signature: '...'}
}In Grant v5 the decoded JWT can only be returned by using the response configuration explicitly:
{
"google": {
"response": ["tokens", "raw", "jwt"]
}
}The decoded JWT will be available as jwt.id_token instead:
{
id_token: '...',
access_token: '...',
refresh_token: '...',
raw: {
id_token: '...',
access_token: '...',
refresh_token: '...',
some: 'other data'
},
jwt: {id_token: {header: {}, payload: {}, signature: '...'}}
}responseconfiguration
In Grant v4 the protocol and the host were used to construct the origin of your client server:
{
"defaults": {
"protocol": "http",
"host": "localhost:3000"
}
}In Grant v5 it is reommended to use the origin configuration instead:
{
"defaults": {
"origin": "http://localhost:3000"
}
}originconfiguration
In Grant v4 it was possible to set a path prefix:
{
"defaults": {
"protocol": "http",
"host": "localhost:3000",
"path": "/oauth"
}
}The equivalent of the above in Grant v5 is:
{
"defaults": {
"origin": "http://localhost:3000",
"prefix": "/oauth/connect"
}
}prefixconfiguration- path prefix for a middleware
In Grant v4 it was possible to require Express, Koa and Hapi using:
var grant = require('grant-express')
var grant = require('grant-koa')
var grant = require('grant-hapi')In Grant v5 it is recommended to use one of the following:
var grant = require('grant').express()(config)
var grant = require('grant').express()({config, ...})
var grant = require('grant').express(config)
var grant = require('grant').express({config, ...})
var grant = require('grant')({handler: 'express', config})- handler constructors configuration