Authentication flow design #530
sw-joelmut
started this conversation in
Show and tell
Replies: 4 comments 8 replies
-
|
This is a baseline to keep iterating on the auth design. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Creating class diagram ... |
Beta Was this translation helpful? Give feedback.
4 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are planning on improving the authentication flow to provide a better user experience, and to maintain the authentication flow as simple as possible.
To represent how the flow could be, we created a sequence diagram, showing the interaction between the user, agents, and botframework service.
Note
Normal login flow steps
The user when entering on a route that requires authentication or requests a token, the auth flow will request the token, since the user is trying to login, the service will return a SignIn resource, this resource is sent to the user's chat as an oAuth card.
When the user clicks on the SignIn button, the token.botframework website will open, and will notify the Agent through the /api/auth/callback endpoint, sending the magic code.
The Agent will receive the magic code and execute the continuation flow requesting the token to the api.botframework service, and continue the execution of the next route.
The magic code exchange will happen in the background so the user don't have to enter it manually.
Image
Edit tool
https://www.mermaidchart.com/app/dashboard
Code
sequenceDiagram actor user as user participant messages as api/messages (Agents) participant api as api.botframework participant token as token.botframework participant callback as api/auth/callback (Agents) user ->> messages: Trigger route with auth messages ->> messages: Check memory token status break when valid token is in memory Note over messages: Valid token messages -->> user: Continue with selected route end messages ->> api: Get token or sign-in resource alt is a token response Note over messages: Valid token api -->> messages: Token response else is a signin resource response Note over messages: Expired token api -->> messages: SignIn resource (begin) messages -->> user: Send oAuth card (with SignIn resource) user ->> token: Click SignIn button (Sign in page opens) token ->> callback: Send magic code callback -->> token: Signal Success to close the page callback ->> messages: Forward Activity (contains magic code) messages ->> api: Send magic code (continue) api -->> messages: Token response end Note over messages: Authenticated messages ->> messages: Set token in memory messages -->> user: Continue with selected routeBeta Was this translation helpful? Give feedback.
All reactions