0

I'm using django oauth toolkit. When my client react-oidc app makes request to the authority djangoapp_domain/oauth/authorize (In my case localhost:8000/oauth/authorize), I get the error:

ImproperlyConfigured at /oauth/authorize/
This application does not support signed tokens

I'm expecting to get an JWT access token containing the set claims. I've tested the django app with Postman and when a request is made to the above given URL, everything works fine and I get the required result.

Can someone guide me in the right direction?

Here's my client side code:

import React from 'react';
import { AuthProvider } from 'oidc-react';
import logo from './logo.svg';
import './App.css';
import LoggedIn from './LoggedIn';

const oidcConfig = {
  onSignIn: async (user: any) => {
    alert('You just signed in, congratz! Check out the console!');
    console.log(user);
    window.location.hash = '';
  },
  authority: 'http://localhost:8000/oauth/',
  clientId:
    'HKkGqXLCh6Qtppc2jbpnozSBwCEFIst00D6ToG8S',
  responseType: 'id_token',
  redirectUri:'http://localhost:3000/',
};

function App() {
  return (
    <AuthProvider {...oidcConfig}>
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <p>OIDC React</p>
          <LoggedIn />
        </header>
      </div>
    </AuthProvider>
  );
}

export default App;

In the django application, oauth toolkit is added in the installed apps:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'users',
    'oauth2_provider',
]

The urls.py file:

    path('oauth/', include('oauth2_provider.urls', namespace='oauth2_provider')),

0 Answers0