Which callback(s) needs this information?
export interface AuthCustomizer<S extends SchemaTypeDefinition = AnySchemaTypeDefinition> {
/** Invoked to look up a login name */
lookupUsername?: (params: LookupUsernameParameters<S>) => Promise<number | null> | number | null;
/** Invoked to verify whether a user is allowed to login */
isAllowedToLogin?: (params: IsAllowedToLoginParameters<S>) => Promise<LoginDeniedInfo | null> | LoginDeniedInfo | null;
/** Invoked after authenticating a user but before returning him to the openid client. Can be used to implement additional authorization and reject the user */
onOpenIdReturn?: (params: OpenIdRequestParameters<S>) => Promise<NavigateInstruction | null> | NavigateInstruction | null;
/** Invoked when creating an OpenID Token for a third party. Allows you to add or modify claims before it's signed */
onOpenIdToken?: (params: OpenIdRequestParameters<S>, payload: JWTPayload) => Promise<void> | void;
/** Invoked when the /userinfo endpoint is requested. Allows you to add or modify the returned fields */
onOpenIdUserInfo?: (params: OpenIdRequestParameters<S>, userinfo: ReportedUserInfo) => Promise<void> | void;
/** Invoked when creating an access token. Allows you to add or modify claims before it's signed */
onFrontendIdToken?: (params: FrontendRequestParameters<S>, payload: JWTPayload) => Promise<void> | void;
/** Invoked when the user logged in to the frontend, returned to clientside JavaScript */
onFrontendUserInfo?: (params: FrontendRequestParameters<S>) => Promise<object> | object;
}
it doesn't make sense or is readily accessible for all of them, so I need to look into them if we can/should just pass the IP address or the full request information with headers - I wonder if you ever need anything other than the IP and if we need to bother building a partial WebRequest object (eg with useragent/device info headers too)
Also wondering if you only need it for isAllowedToLogin or if other APIs can/should be affected too as this also affects cacheability of the checks