Next.js Discord

Discord Forum

Struggling to setup Atlassian w/ next-auth

Song Sparrow posted this in #help-forum
Open in Discord
Song SparrowOP
Hey all, I'm struggling to work with/setup an Atlassian login w/ my NextJS 13 app. I keep getting the page in the attached screenshot instead of the expected sign-in screen.

Here's my code:
import NextAuth, { type DefaultSession } from 'next-auth';
import Atlassian from "next-auth/providers/atlassian";

declare module 'next-auth' {
  interface Session {
    user: {
      /** The user's id. */
      id: string;
    } & DefaultSession['user'];

export const {
  handlers: { GET, POST },
} = NextAuth({
  providers: [
      clientId: process.env.ATLASSIAN_CLIENT_ID,
      clientSecret: process.env.ATLASSIAN_CLIENT_SECRET,
      authorization: {
        params: {
          scope: "read:me read:account read:confluence-space.summary read:confluence-props read:confluence-content.all read:confluence-content.summary search:confluence read:confluence-content.permission read:confluence-user read:confluence-groups readonly:content.attachment:confluence read:jira-work read:jira-user"
  callbacks: {
    jwt: async ({ token, profile }) => {
      if (profile) { =;
        token.image = profile.picture;
      return token;
    signIn: async ({account, profile}) => {
      // TODO: this is where we will validate w/ backend database of users
      console.log('sign in ran', account, profile);
      return true
  pages: {
    signIn: '/sign-in',

Other notes:
- I've added my callback url here:
- I got the client id and secret from here:
- My distribution status is set to "Sharing"
- I've added the relevant scopes (i.e. scopes in the above code) to (but I don't think this should make a difference)

0 Replies