oauth-v2-client
Version:
Oauth V2 client based on axios
21 lines (20 loc) • 862 B
TypeScript
import { OauthClientConfig } from "../interfaces";
import GetAuthorizationUriFuncType from "../interfaces/GetAuthorizationUrlFuncConfig";
import ImplicitGrantOptions from "../interfaces/ImplicitGrantOptions";
import GrantControl from "./GrantControl";
export default class ImplicitGrantControl extends GrantControl {
private options;
private redirectUri;
constructor(config: OauthClientConfig, options: ImplicitGrantOptions);
/**
* Get authentication url
* @param {GetAuthorizationUriFuncType} options redirect uri, response type
*/
getAuthUri(options?: GetAuthorizationUriFuncType): string;
/**
* Extract the token within the callback uri
* @param callbackUrl the full callback uri
* @param state state
*/
getToken<T = any>(callbackUrl: string, state?: string | string[]): T;
}