authentik icon indicating copy to clipboard operation
authentik copied to clipboard

Update source docs with new property mappings

Open rissson opened this issue 1 year ago • 2 comments

With #8771, it is now possible to get additional properties from an OAuth and SAML source, plus getting groups and syncing those. We need to update our sources documentation with those changes. As some of those docs are community supported, I'm opening this issue to ping whomever made recent changes to those if they want to update them with the new (and recommended) way of getting that data. Those changes will make it in 2024.8, so it may be a bit difficult to try things out just yet, but the currently documented way of getting data will still work until the documentation can be changed.

Documentation for those changes is available in #10652 (see the authentik-docs comment for the preview link). Please link back to this issue if you open a PR for those.

  • [ ] AzureAD - @tograss
  • [ ] Discord - authentik support level, but we've seen a lot of contribution on this so - @Keyinator @Aterfax
  • [ ] GitHub - authentik support level, but we've seen a lot of contribution on this so - @TheMythologist
  • [ ] Google - community supported

rissson avatar Aug 01 '24 17:08 rissson

If I understand correctly

request.context["oauth_userinfo"]["email"]

would become

request.context["source"]["info"]["email"]

Also do we have docs on how to use the OAuth client object (i.e. what methods are available)?

From my understanding

requests.get(
    GUILD_API_URL,
    headers= {
        "Authorization": f"Bearer {access_token}",
    }
).json()

would become something like

request.context["source"]["client"].get(GUILD_API_URL)

Keyinator avatar Aug 01 '24 20:08 Keyinator

Not quite. Instead of getting all that information in the flow, you'd write property mappings to get that information. I'll update one of the sources examples once we get everything merged, so we'll have an example to refer to.

rissson avatar Aug 05 '24 13:08 rissson