Skip to main content
Version: 0.14.0 (Latest)

📐 OAuth schemas

OAuth exports five reusable OpenAPI query parameters and three initiation schemas. Callback routes compose no schema, including for their state query.

Inventory

ExportRequest locationContract
fpQueryParameterQueryRequired string fp.
purposeQueryParameterQueryRequired oauth-login or oauth-signup.
redirectUrlQueryParameterQueryRequired string redirectUrl.
typeIdQueryParameterQueryOptional string typeId.
stateQueryParameterQueryRequired string state; currently uncomposed.
googleOauthSchemaQuery, bodyGoogle initiation parameters and an empty JSON object body.
lineOauthSchemaQuery, bodyLINE initiation parameters and an empty JSON object body.
twitterOauthSchemaQuery, bodyTwitter initiation parameters and an empty JSON object body.

Details

fpQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QueryfpstringYesFingerprint value used in Google and LINE state.

Spread by googleOauthSchema and lineOauthSchema. Used by route: googleOAuthRoute and lineOAuthRoute. Used by feature: googleOAuthFeature and lineOAuthFeature.

View complete source
export const fpQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'fp',
required: true,
schema: {type: 'string'},
};

purposeQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QuerypurposestringYesEnum oauth-login, oauth-signup.

Spread by googleOauthSchema, lineOauthSchema, and twitterOauthSchema. Used by route: googleOAuthRoute, lineOAuthRoute, and twitterOAuthRoute. Used by feature: googleOAuthFeature, lineOAuthFeature, and twitterOAuthFeature.

View complete source
export const purposeQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'purpose',
required: true,
schema: {enum: [OAUTH_LOGIN, OAUTH_SIGNUP], type: 'string'},
};

redirectUrlQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QueryredirectUrlstringYesCallback destination; later decoded and receives onetimeToken.

Spread by googleOauthSchema, lineOauthSchema, and twitterOauthSchema. Used by route: googleOAuthRoute, lineOAuthRoute, and twitterOAuthRoute. Used by feature: googleOAuthFeature, lineOAuthFeature, and twitterOAuthFeature.

View complete source
export const redirectUrlQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'redirectUrl',
required: true,
schema: {type: 'string'},
};

typeIdQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QuerytypeIdstringNoRequired later only when a new oauth-signup identity is created.

Spread by googleOauthSchema, lineOauthSchema, and twitterOauthSchema. Used by route: googleOAuthRoute, lineOAuthRoute, and twitterOAuthRoute. Used by feature: googleOAuthFeature, lineOAuthFeature, and twitterOAuthFeature.

View complete source
export const typeIdQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'typeId',
required: false,
schema: {type: 'string'},
};

stateQueryParameter

Definition
LocationFieldTypeRequiredConstraints
QuerystatestringYesPublic reusable parameter; no OAuth schema or feature currently uses it.

Google and LINE callbacks read requestQuery.state directly; this declaration does not validate them.

View complete source
export const stateQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'state',
required: true,
schema: {type: 'string'},
};

googleOauthSchema

Definition

Used by route: googleOAuthRoute. Used by feature: googleOAuthFeature.

LocationFieldTypeRequiredConstraints
QueryfpstringYesShared parameter.
QuerypurposestringYesShared enum.
QueryredirectUrlstringYesShared parameter.
QuerytypeIdstringNoShared parameter.
BodyobjectNoapplication/json, maxProperties: 0; no fields allowed.
View complete source
export const googleOauthSchema = withSchema({
parameters: [fpQueryParameter, purposeQueryParameter, redirectUrlQueryParameter, typeIdQueryParameter],
requestBody: {content: {'application/json': {schema: {maxProperties: 0, type: 'object'}}}},
});

lineOauthSchema

Definition

Used by route: lineOAuthRoute. Used by feature: lineOAuthFeature.

LocationFieldTypeRequiredConstraints
QueryfpstringYesShared parameter.
QuerypurposestringYesShared enum.
QueryredirectUrlstringYesShared parameter.
QuerytypeIdstringNoShared parameter.
BodyobjectNoapplication/json, maxProperties: 0; no fields allowed.
View complete source
export const lineOauthSchema = withSchema({
parameters: [fpQueryParameter, purposeQueryParameter, redirectUrlQueryParameter, typeIdQueryParameter],
requestBody: {content: {'application/json': {schema: {maxProperties: 0, type: 'object'}}}},
});

twitterOauthSchema

Definition

Used by route: twitterOAuthRoute. Used by feature: twitterOAuthFeature.

LocationFieldTypeRequiredConstraints
QuerypurposestringYesShared enum.
QueryredirectUrlstringYesShared parameter.
QuerytypeIdstringNoShared parameter.
BodyobjectNoapplication/json, maxProperties: 0; no fields allowed.
View complete source
export const twitterOauthSchema = withSchema({
parameters: [purposeQueryParameter, redirectUrlQueryParameter, typeIdQueryParameter],
requestBody: {content: {'application/json': {schema: {maxProperties: 0, type: 'object'}}}},
});