goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
12.87k stars 856 forks source link

Custom Development Challenge: Integrating User Management Frontend with Authentik #7738

Open dantest21 opened 9 months ago

dantest21 commented 9 months ago

I am developing a custom frontend for user management, using Express (Node.js) and Python, designed to integrate seamlessly with Authentik. However, I've encountered an issue related to search queries with pagination and custom attributes, specifically the 'admin_group' attribute.

Issue Description: My application needs to send search requests to Authentik that include pagination details and a custom attribute, 'admin_group'. The query needs to be formatted as ?attributes={"admin_group":true} or ?attributes={"admin_group":false} in the URL.

Encountered Problem: The issue arises when these attributes are URL-encoded, resulting in a format like attributes=%7B%22admin_group%22%3A%20true%7D. It seems that Authentik does not process or recognize this encoded format as expected. image

Technical Context:

Frontend Development: Utilizing Express (Node.js) and Python. Integration Objective: Effective communication with Authentik for user management functionalities. Specific Requirement: Ensuring the 'admin_group' attribute in search queries is correctly formatted and processed by Authentik. "Input should be a valid dictionary or object to extract fields from"

/api/v3/core/groups/?page=1&attributes=%7B"admin_group"%3A%20false%7D

Request for Assistance: I am seeking insights, guidance, or potential solutions on how to format these search queries appropriately. Any advice or alternative approaches to pass the 'admin_group' attribute effectively in a manner that Authentik can process would be greatly appreciated.

Thank you for your support and guidance in resolving this challenge. I look forward to your valuable input.

BeryJu commented 1 month ago

Not directly an answer to your question, but since you are using express/js, I'd recommend using the authentik API client: https://www.npmjs.com/package/@goauthentik/api. This should also take care of any kind of encoding for search queries like that