/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * @internal */ export interface IOdspTokens { readonly accessToken: string; readonly refreshToken?: string; readonly receivedAt?: number; readonly expiresIn?: number; } /** * Configuration for a public client. * @internal */ export interface IPublicClientConfig { clientId: string; } /** * @legacy @beta */ export interface IOdspAuthRequestInfo { accessToken: string; refreshTokenFn?: () => Promise; } /** * @internal */ export type TokenRequestCredentials = { grant_type: "authorization_code"; code: string; redirect_uri: string; } | { grant_type: "refresh_token"; refresh_token: string; } | { grant_type: "password"; username: string; password: string; }; /** * @legacy @beta */ export declare const getOdspScope: (server: string) => string; /** * @legacy @beta */ export declare const pushScope = "offline_access https://pushchannel.1drv.ms/PushChannel.ReadWrite.All"; /** * @internal */ export declare function getFetchTokenUrl(server: string): string; /** * @internal */ export declare function getLoginPageUrl(server: string, clientConfig: IPublicClientConfig, scope: string, odspAuthRedirectUri: string): string; /** * Issue the requestCallback, providing the proper auth header based on authRequestInfo, * and retrying with a refreshed token if necessary. * @internal */ export declare function authRequestWithRetry(authRequestInfo: IOdspAuthRequestInfo, requestCallback: (config: RequestInit) => Promise): Promise; //# sourceMappingURL=odspAuth.d.ts.map