In botframework-sdk all of a sudden my bot started to get this error Error: Get Token request returned http error: 401 - azure

All of a sudden my bot started to get this error:
[onTurnError] unhandled error: Error: Get Token request returned http error: 401 and server response: {"error":"invalid_client","error_description":"AADSTS7000222: The provided client secret keys are expired. Visit the Azure Portal to create new keys for your app, or consider using certificate credentials for added security: https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials\r\nTrace ID: 91097c7f-35a4-4f95-97bc-d616a6b45100\r\nCorrelation ID: e0110013-d13c-4897-aafc-f2e36a194ed5\r\nTimestamp: 2021-03-01 20:00:25Z","error_codes":[7000222],"timestamp":"2021-03-01 20:00:25Z","trace_id":"91097c7f-35a4-4f95-97bc-d616a6b45100","correlation_id":"e0110013-d13c-4897-aafc-f2e36a194ed5","error_uri":"https://login.microsoftonline.com/error?code=7000222"}

It sounds like your Direct Line secret has expired, assuming you are trying to hit https://directline.botframework.com/v3/directline/tokens/generate. You can regenerate them by going to the Bot Service blade, selecting your Bot Service, and then clicking on Channels. Click Edit on your Direct Line channel and you'll have the option to regenerate your key(s).

Related

Error 403 Forbidden when connect to Microsoft Defender API using Filebeat

I am trying to connect to Microsoft Defender API using Elastic Filebeat. I followed the instructions here register a new application with granted permission.
Create app for Microsoft Defender
However, when trying to call the api, i encountered this message:
Error while processing http request: failed to execute http client.Do:
server responded with status code 403:
{"error":{"code":"Forbidden","message":"The application does not have
any of the required application permissions (Alert.ReadWrite.All,
Alert.Read.All, Incident.ReadWrite.All, Incident.Read.All) to access
the resource.","target":}} {"input_source":
"https://api.security.microsoft.com/api/incidents", "input_url":
"https://api.security.microsoft.com/api/incidents"}
Can anyone assist me on this ?
EDIT: Added JWT token screenshot for reference if needed
JWT decoded screenshot
Your token lacks permissions, you need to use the client credential flow to obtain the token:
Parse the token:

Trying O365 Authentication in Xamarin forms app

We are new to O365 Authentication and trying to authenticate the user.
Here i am getting this error while trying to login with, office 365.
Create app in active directory add app id and return urls in app, and this is the document I followed, https://blog.xamarin.com/put-adal-xamarin-forms/
here is the error we are getting,
AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'
Trace ID: e580114e-2dd9-4cc4-b903-6cef743a2900
Correlation ID: 6e58ff9d-bea4-4ad3-9fe3-e27c92fc9597
Timestamp: 2018-12-05 12:51:23Z
{System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). ---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: {"error":"invalid_client","error_description":"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'\r\nTrace ID: e580114e-2dd9-4cc4-b903-6cef743a2900\r\nCorrelation ID: 6e58ff9d-bea4-4ad3-9fe3-e27c92fc9597\r\nTimestamp: 2018-12-05 12:51:23Z","error_codes":[70002],"timestamp":"2018-12-05 12:51:23Z","trace_id":"e580114e-2dd9-4cc4-b903-6cef743a2900","correlation_id":"6e58ff9d-bea4-4ad3-9fe3-e27c92fc9597"}: Unknown error
--- End of inner exception stack trace ---}
Ok ,Maybe you have registered your app as a confidential client (web app or web api).
You cannot authenticate with username and password when the app is a confidential client. Only public clients, sometimes known as native clients, can do U/P authentication.
Trying to Change to native client.
Refer to this link to try

Bing Speech REST API errors occur

When I call the bing speech rest api a few days ago, I get an error and do not return a result.
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at SpeechRESTSample.Program.Main(String[] args) in C:\Users\kaki1\Source\Repos\Cognitive-Speech-STT-ServiceLibrary\sample\SpeechRESTSample\Program.cs:line 78
The remote server returned an error: (503) Server Unavailable.
Renewed token.
or Internal Server Error
Does not provide services?
If I use the sample code directly to get the token then I got the 401 error.
The FetchTokenUri is changed from https://api.cognitive.microsoft.com/sts/v1.0 to
https://{region}.api.cognitive.microsoft.com/sts/v1.0/issueToken
we could get the authentication endpoint from this link.
And the endpoints for the Speech to Text REST API is the following format
https://{region}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1
I also test it locally I can get the token with the endpoint.
For more demo code, please refer to this.

Tweepy Error: Your credentials do not allow access to this resource

I am using Tweepy to build a Telegram-based twitter client and when I try to post a tweet, I receive the following error message:
"TweepError occurred, args=([{'code': 220, 'message': 'Your credentials do not allow access to this resource.'}],)
I've managed to overcome this once, when I logged out and logged back in to my Twitter account (I'm using oauth with PIN verifier). But after some time posting stops working again and this error reoccurs.
How do I avoid this error with a single authentication?
I save access token and secret to a separate file and the application permissions are set to Write, Read, Access direct messages.

error on sending skype BOT messges

I have obtained the access token via https://login.microsoftonline.com/common/oauth2/v2.0/token and with that token tried to send a message using this url https://apis.skype.com/v3/conversations/conversationId/activities/. But i am getting this error "401: The provided 'OAuth' ticket failed authentication.".
What could be the issue here

Resources