Skip to content

Microsoft SSO app-only access #178

Closed Answered by tomasvotava
developer992 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!
I don't think you can use fastapi-sso to obtain an app-only token, nor you need to, because in this kind of authentication there's no client side. You only need to send a single request to the API and you will get an access token that you can use further. E.g. using requests library:

from requests import Session

def get_token(client_id: str, client_secret: str, tenant: str = "common") -> str:
    session = Session()
    response = session.post(
        f"https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token",
        data={
            "client_id": client_id,
            "client_secret": client_secret,
            "grant_type": "client_credentials",
            "scope": "https…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tomasvotava
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants