📐 OAuth schemas
OAuth exports five reusable OpenAPI query parameters and three initiation schemas. Callback routes compose no schema, including for their state query.
Inventory
| Export | Request location | Contract |
|---|---|---|
fpQueryParameter | Query | Required string fp. |
purposeQueryParameter | Query | Required oauth-login or oauth-signup. |
redirectUrlQueryParameter | Query | Required string redirectUrl. |
typeIdQueryParameter | Query | Optional string typeId. |
stateQueryParameter | Query | Required string state; currently uncomposed. |
googleOauthSchema | Query, body | Google initiation parameters and an empty JSON object body. |
lineOauthSchema | Query, body | LINE initiation parameters and an empty JSON object body. |
twitterOauthSchema | Query, body | Twitter initiation parameters and an empty JSON object body. |
Details
fpQueryParameter
Definition
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | fp | string | Yes | Fingerprint 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
purposeQueryParameter
Definition
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | purpose | string | Yes | Enum 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
redirectUrlQueryParameter
Definition
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | redirectUrl | string | Yes | Callback 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
typeIdQueryParameter
Definition
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | typeId | string | No | Required 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
stateQueryParameter
Definition
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | state | string | Yes | Public 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
googleOauthSchema
Definition
Used by route: googleOAuthRoute. Used by feature: googleOAuthFeature.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | fp | string | Yes | Shared parameter. |
| Query | purpose | string | Yes | Shared enum. |
| Query | redirectUrl | string | Yes | Shared parameter. |
| Query | typeId | string | No | Shared parameter. |
| Body | — | object | No | application/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.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | fp | string | Yes | Shared parameter. |
| Query | purpose | string | Yes | Shared enum. |
| Query | redirectUrl | string | Yes | Shared parameter. |
| Query | typeId | string | No | Shared parameter. |
| Body | — | object | No | application/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.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| Query | purpose | string | Yes | Shared enum. |
| Query | redirectUrl | string | Yes | Shared parameter. |
| Query | typeId | string | No | Shared parameter. |
| Body | — | object | No | application/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'}}}},
});