Skip to content

Authenticate users via on-premise Active Directory Federation Services (AD FS) #6622

Closed Answered by matthijs110
matthijs110 asked this question in Help
Discussion options

You must be logged in to vote

I ended up implementing my own custom provider for ADFS. Here's what I created 2 years ago:

import { OAuthConfig, OAuthUserConfig } from "next-auth/providers"


export interface ADFSProfile extends Record<string, any> {
  /**
   * The subject of the JWT (user)
   */
  sub: string;

  /**
   * The display name of the user
   */
  unique_name: string;

  /**
   * The company email address of the user.
   */
  email: string;
  
  /**
   * The assigned role(s) of the user.
   */
  role: string | string[];
}

/**
 * Configures Active Directory Federation Services as a NextAuth provider.
 */
export default function ADFS<P extends ADFSProfile>(
  options: OAuthUserConfig<P> & {

    /**
     * T…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@abonnell
Comment options

@matthijs110
Comment options

Answer selected by matthijs110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants