UNPKG

remix-auth-okta

Version:

![CI](https://img.shields.io/github/actions/workflow/status/jrakotoharisoa/remix-auth-okta/main.yml?branch=main&style=flat-square) ![npm](https://img.shields.io/npm/v/remix-auth-okta?style=flat-square) # OktaStrategy

40 lines (39 loc) 1.56 kB
import type { SessionStorage } from "@remix-run/server-runtime"; import { AuthenticateOptions, StrategyVerifyCallback } from "remix-auth"; import { OAuth2Strategy, OAuth2StrategyOptions, OAuth2StrategyVerifyParams } from "remix-auth-oauth2"; export interface OktaProfile { provider: string; id: string; displayName: string; name: { familyName: string; givenName: string; middleName: string; }; email: string; } export type OktaStrategyOptions = Omit<OAuth2StrategyOptions, "authorizationURL" | "tokenURL"> & { scope?: string; issuer: string; } & ({ withCustomLoginForm: true; oktaDomain: string; } | { withCustomLoginForm?: false; oktaDomain?: never; }); export type OktaExtraParams = Record<string, string | number>; export declare class OktaStrategy<User> extends OAuth2Strategy<User, OktaProfile, OktaExtraParams> { name: string; private userInfoURL; private authenticationURL; private readonly scope; private readonly withCustomLoginForm; private sessionToken; constructor({ issuer, scope, clientID, clientSecret, callbackURL, ...rest }: OktaStrategyOptions, verify: StrategyVerifyCallback<User, OAuth2StrategyVerifyParams<OktaProfile, OktaExtraParams>>); authenticate(request: Request, sessionStorage: SessionStorage, options: AuthenticateOptions): Promise<User>; private getCallbackURLFrom; private getSessionTokenWith; protected authorizationParams(): URLSearchParams; protected userProfile(accessToken: string): Promise<OktaProfile>; }