MAGDA Authentication Plugin SDK
Please information please refer to the Authentication Plugin Spec
Existing Magda Authentication Plugins can be found from here.
You can use this repo as a template to create your own magda authentication plugin.
export declare function createMagdaSessionRouter(
options: MagdaSessionRouterOptions
): Router;
export declare async function destroyMagdaSession(
req: Request,
res: Response,
cookieOptions: SessionCookieOptions
): Promise<void>;
export declare function createOrGetUserToken(
authApi: AuthApiClient,
profile: passport.Profile,
source: string,
beforeUserCreated?: (
authApiClient: AuthApiClient,
userData: User,
profile: passport.Profile
) => Promise<User>,
afterUserCreated?: (
authApiClient: AuthApiClient,
user: User,
profile: passport.Profile
) => Promise<void>
): Promise<UserToken>;
export declare function getAbsoluteUrl(
url: string,
baseUrl: string,
optionalQueries?: {
[key: string]: string;
},
allowedUrlHosts?: string[]
): string;
export declare function redirectOnSuccess(
toURL: string,
req: Request,
res: Response
): void;
export declare function redirectOnError(
err: any,
toURL: string,
req: Request,
res: Response
): void;