Skip to content
Discussion options

You must be logged in to vote

working code for custom user info. identity server 4

import axios from 'axios';
import NextAuth from 'next-auth';
import IdentityServer4Provider from 'next-auth/providers/identity-server4';

export default NextAuth({
  providers: [
    IdentityServer4Provider({
      id: 'identity-server4',
      name: 'IdentityServer4',
      issuer: 'https://demo.identityserver.io',
      clientId: 'interactive.public',
      clientSecret: 'secret',
      userinfo: {
        url: 'https://demo.identityserver.io/connect/userinfo',
        async request(context) {
          const res = await axios.get('https://demo.identityserver.io/connect/userinfo', {
            headers: {
              Authorization: `…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@balazsorban44
Comment options

@always-maap
Comment options

@balazsorban44
Comment options

@always-maap
Comment options

@balazsorban44
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by always-maap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #3524 on December 27, 2021 16:31.