OAuth-style LogIn allows you to invite users to log-in using your existing authentication flow thus to provide a more secure, personalized and relevant experience to users.
To request a Log In return a special message of type LoginOAuthEvent from any applicative webhook.
As this is an interactive message it can only be the last in the list of returned messages and there can only be a single interactive message in the list.
Here is an example of such a reply:
{ "botkitVersion": "0.3.0", "messages": [ { "_type": "LoginOAuthEvent", "loginSuccessHook": { "webhook": "flight_boarding_pass" }, "text": "Please Login in first", "webLoginUrl": "https://chat.evature.com/demo_login" } ] }
- _type - Must be LoginOAuthEvent
- loginSuccessHook - a JSON object with either webhook - an enumeration of an existing webhook, or url
- text - any text message - mandatory.
- webLoginUrl - a URL to the web login page.
The URL webLoginUrl will be extended with a query parameter called redirect_uri.
If the log in is successful, redirect the browser to the redirect_uri specified in your callback to complete the flow, and append a new authorization_code query parameter. Eva will add the contents of authorization_code to the subsequent
applicative webhook calls as a new key called privateId.
Detailed BotKit docs can be found here: http://docs.evature.com/botkit.html
No comments:
Post a Comment