gitlab-acebase
Version:
AceBase realtime database server (webserver endpoint to allow remote connections)
44 lines • 1.72 kB
TypeScript
import { IOAuth2ProviderSettings, IOpenIDToken, IOpenIDConfiguration, IOAuth2AuthCodeParams, IOAuth2RefreshTokenParams, OAuth2ProviderInitInfo, OAuth2Provider } from './oauth-provider';
/**
* Details of your app to access the Gitlab API. See https://developers.Gitlab.com/identity/protocols/oauth2/scopes
*/
export interface IGitlabAuthSettings extends IOAuth2ProviderSettings {
/** 'openid', 'email', 'profile' and additional scopes you want to access. */
scopes?: string[];
host: string;
}
interface IGitlabAuthToken {
access_token: string;
expires_in: number;
expires: Date;
id_token: IOpenIDToken;
refresh_token: string;
scope: string;
token_type: string;
}
export declare class GitlabAuthProvider extends OAuth2Provider {
_config: IOpenIDConfiguration;
constructor(settings: IGitlabAuthSettings);
getOpenIDConfig(): Promise<IOpenIDConfiguration>;
/**
* Starts auth flow by getting the url the user should be redirected to
* @param info.redirectUrl Url spotify will redirect to after authorizing, should be the url
* @param info.state Optional state that will be passed to redirectUri by spotify
*/
init(info: OAuth2ProviderInitInfo): Promise<string>;
getAccessToken(params: IOAuth2AuthCodeParams | IOAuth2RefreshTokenParams): Promise<IGitlabAuthToken>;
getUserInfo(access_token: string): Promise<{
id: string;
name: string;
display_name: string;
picture: {
url: string;
}[];
email: string;
email_verified: boolean;
other: {};
}>;
}
export declare const AuthProvider: typeof GitlabAuthProvider;
export {};
//# sourceMappingURL=gitlab.d.ts.map