Skip to content

HTTP Basic Auth support for introspection #709

@Abhishek8394

Description

@Abhishek8394

Expanding upon the issue #529

It seems that introspection endpoint is not allowing client authentication via HTTP Basic auth. As mentioned in the comments in the code at introspect.py#L13
The RFC allows for HTTP basic auth: https://tools.ietf.org/html/rfc7662#section-2.1

It seems that the authentication is bound to access tokens. This is a problem because the only straight forward way to get access tokens is using client_credentials grant type. But currently apps are allowed only one grant type.

Reproducing issue

  1. Create an confidential application with grant type authorization_code
  2. Get an access token for some user with respect to the newly created app.
  3. send introspection request
import requests
import base64
CLIENT_ID='aa'
CLIENT_SECRET='aa'

def introspect(access_token):
	payload = {
		'token': access_token
	}
	auth = base64.b64encode((CLIENT_ID + ':' + SECRET).encode())
	resp = requests.post('http://localhost:8000/o/introspect/', payload, 
		headers={
			'Authorization': 'Basic ' + auth.decode('latin-1')
		})
	return resp

print(introspect('tokenhere').text)

There is a workaround proposed for going into django admin and creating an access token for the app but that wouldn't scale.

An alternative would be to use the setting for resource auth token and exclusively allow it only for introspection routes. That might work too, but it would have you leak your introspection token across several resource services.

I would like to work on this if this qualifies as a bug/issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions