nextauthjs / nextauthjs/next-auth

Azure AD Provider - Profile image doesn't work

Open
#5,376 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

providers triage
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Provider type

Azure Active Directory

Environment

System:
OS: macOS 12.5.1
CPU: (8) arm64 Apple M2
Memory: 2.47 GB / 24.00 GB
Shell: 3.5.1 - /opt/homebrew/bin/fish
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Browsers:
Chrome: 105.0.5195.125
Safari: 15.6.1

Reproduction URL

https://github.com/DavidIlie/next-auth-azure-ad-problem

Describe the issue

Profile image request results in an error using the auth token from Microsoft Oauth and therefore there is no profile picture:

image
AzureADProvider({
    clientId: process.env.AUTH_AZURE_CLIENT_ID as string,
    clientSecret: process.env.AUTH_AZURE_CLIENT_SECRET as string,
    tenantId: process.env.AUTH_AZURE_TENANT_ID as string,
    id: "microsoft",
}),
How to reproduce

Simply create a Azure AD Provider from the guide and you will see that there is no profile picture

Expected behavior

There should be a profile picture fetched and saved in base64 in the JWT or the database (depends on the config)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Azure AD Provider guide and the linked reproduction URL, then trace how the provider maps the Microsoft OAuth token into the user profile. Reproduce the profile-image request error and determine the provider path responsible; done means a profile picture is fetched successfully and saved in the configured JWT or database.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.