-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Token not being cached for bot authentication with users and magic numbers don't work #4899
Comments
Are you using teams? If not what channel? |
@JasonSowers , yes I am using Teams |
You have to type in the code for teams, copying and pasting will make the text input be like “\r\n804230\n” or something similar. I wrote a regex that can handle this programmatically I can post shortly. |
This is just one way to handle this in your code. You could probably find a better way of doing this. In my messages controller I put a check for the magic code copy paste like this: if (activity.Type == ActivityTypes.Message)
{
if (activity.ChannelId == ChannelIds.Msteams && activity.Text.StartsWith("\r\n"))
{
activity.Text = CustomCode.SanatizeMagicCodeForTeams(activity.Text);
}
await Conversation.SendAsync(activity, () => new RootDialog());
} Then I wrote this simple static class to handle it: public static class CustomCode
{
public static string SanatizeMagicCodeForTeams(string magicCode)
{
Regex regex = new Regex(@"\r\n(\d{6})\n");
var match = regex.Match(magicCode);
if (match.Success)
{
magicCode = magicCode.Substring(2, 6);
}
return magicCode;
}
} |
@Rykimaruh let me know if that helps |
@JasonSowers it works! Thank you! Were you able to check up on other issue pertaining the cached token and the emulator? |
@Rykimaruh can you remind me which issue you are talking about specifically? |
"I am getting the same problem as my previous one with token no caching as it should. This happens in the emulator though. It was able to hold the cached token before, but now it doesn't. This happened before the following issue happened." It would seem token caching is having issues again. Can this be verified? |
Ahh yes, this issue resurfaced, it should be fixed now. Apologies, as I am trying to help resolve many Auth issues and I know I had been talking to you on other threads. Someone else pointed this out earlier and I was able to get the team to deploy a temporary fix until we have a more permanent one in our next release. When this happens, try to check another channel, if it doesn't happen on another channel it's an issue with the emulator and please let us know as you did. If you start seeing trouble with the emulator and you have had it running for a while(~8 hours), restart the emulator. The emulator uses ngrok, and ngrok sessions expire after 8 hours. |
@JasonSowers , it was working for a short while, but it seems the issue came back once again. |
It should be fixed again, it will be permanently fixed in our next deployment. Thanks for reporting. |
Going to close this issue. Please open a new one if you experience anything else we can help with. |
Hello,
I am getting the same problem as my previous one with token no caching as it should. This happens in the emulator though. It was able to hold the cached token before, but now it doesn't. This happened before the following issue happened.
The other issue is that whenever I paste the authentication number to chat, the bot tells me an error message as follow:
The text was updated successfully, but these errors were encountered: