UNPKG

@mvx/identity

Version:

identity is oidc for mvc, type-mvc is base on koa. Decorator, Ioc, AOP mvc framework on server.

37 lines (36 loc) 1.24 kB
import { StateStore, StoreMeta, VerifyResult } from './StateStore'; import { Context } from 'koa'; /** * Creates an instance of `SessionStore`. * * This is the state store implementation for the OAuth2Strategy used when * the `state` option is enabled. It generates a random state and stores it in * `req.session` and verifies it when the service provider redirects the user * back to the application. * * This state store requires session support. If no session exists, an error * will be thrown. * */ export declare class SessionStore extends StateStore { private key; constructor(key: string); /** * Store request state. * * This implementation simply generates a random string and stores the value in * the session, where it will be used for verification when the user is * redirected back to the application. * */ store(ctx: Context, meta?: StoreMeta): Promise<string>; /** * Verify request state. * * This implementation simply compares the state parameter in the request to the * value generated earlier and stored in the session. * */ verify(ctx: Context, providedState: string): Promise<VerifyResult>; static ρAnn(): any; }