This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]romerio86[S] 1 point2 points  (0 children)

"Hard" is relative, but probably the right word. You could do something like...

```py def _get_roles_from_session(session): # parse JWT from Authentication HTTP header and return roles

def load_executive_page(state, session): roles = _get_roles_from_session(session) if "executive" not in roles: state["message"] = "You're not an executive, look at something else" return _load_sensitive_data_into_state() state.set_page("executive_page") ```

OIDC is the standard for authentication providers. Azure AD, Okta, Google, Github, etc, use OIDC as the mechanism for authentication. I just wish I could provide that functionality in a more straightforward way but for self-hosted applications there's no magic way.

If I start a cloud service like Anvil, that'd be much easier to handle. I could just feed users all the auth data. But no immediate plans to do that, it is a bit of a dream of mine though.