New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Provided Authentication #987
Comments
Yep you can either use the default tokenbackend and store the token as json in a file or define your own tockendbacked that get and sets the token somehow (environment, databade, etc). There are some already done tockendbackends like firebase and more. |
agreed yes we can easily use different token stores, my issue is around how the token is acquired we have a react front end that does all the work and want to be able to pass the token to the python back end, basically no token store needed, the current flows as I understand it do not allow for the access token to be provided externally |
To acquire the token (if you are authenticating on behalf of a user) check: https://github.com/O365/python-o365#different-authentication-interfaces There's is an example on how to do it using a web app interface |
Thanks yea I saw that this flow assumes we are doing three legged and the back end, we are using pkce on front end so the token is maintained there using the msal library, we can pass the current token to the api on the back end when we make the request. This flow assumes the redirect and codes exchange for the token. |
I am trying to achieve a similar thing. I have a Streamlit application that users sign in via MSAL so a token is already held. From there I am struggling to ascertain how to pass the existing token to call O365 functions without directly authenticating via O365. |
It should be possible to load the msal token info into a O364 token class. i can look into it if you can extract this token info from msal |
That would be very helpful. I can access the token, which is currently held in memory. I would like to avoid writing to disk as I have not yet created secure storage. |
I didn't have time for this. But if you have access to the msal token you can extract the token info and load it into a token class then use it in O365 |
I have already authenticated my app with the |
Hi,
This library looks great, and the way it is plugged into langchain is super cool. Question: our users are already authenticated interactively through the front end of our app, and we have the access token required, is there a way we can bypass all the authentication logic, and just give the token? Ive been trying to fool it in the Account Setup, by passing a custom token backend seeded with the token, but pydantic and other places, do not allow it to work unless we call the authenticate function, which has a good amount of rigidity in its checks to get the user in various ways, but none let an external token /session to be provided. Any guidance would be great!
The text was updated successfully, but these errors were encountered: