error on sending skype BOT messges - node.js

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

Related

AAD B2C returned "AADB2C90090: The provided JWE is not a valid 5 segment token." when calling token API

I am working a POC to verify the migration of our Signup & Signup flow to Azure AD B2C. I have successfully called the API authorize to get the access token and id token. Then I tried to call /token to refresh the token according to document , however I got the error message below.
AADB2C90090: The provided JWE is not a valid 5 segment token.\r\nCorrelation ID: ae943eb7-9290-4fd5-aeac-d56411d803c7\r\nTimestamp: 2022-10-26 07:13:40Z\r\n
Following is the url I used to get access token in Browser.
GET https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_signupsignin1&client_id=7adbb5f8-17d2-4dfa-94cd-5ab1cbc9f425&nonce=defaultNonce&redirect_uri=https://jwt.ms&scope=openid offline_access&response_type=code+id_token&prompt=login
Following is the screenshot I used to call token API in Postman.
POST /{tenant}.onmicrosoft.com/B2C_1_signupsignin1/oauth2/v2.0/token HTTP/1.1
Host: {tenant}.b2clogin.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 1971
grant_type=authorization_code&client_id=7adbb5f8-17d2-4dfa-94cd-5ab1cbc9f425&code=eyJraWQiOiJjcGltY29yZV8wOTI1MjAxNSIsInZlciI6IjEuMCIsInppcCI6IkRlZmxhdGUiLCJzZXIiOiIxLjAifQ..n8murSwIYYseViQm.WluJ_gU8aUQd1PPadPik4ODSso4KpKAu8geA5NmAlkbieJPVZb30MJSHGOiUsrxfwu4BoV69bshD7URJeVNFzfqPsCjBhpYDyeL8x0uUZIJwDQ7DTiflw8A4LbYf-SzjluqbfSqDwQFGyQvKesgsrnZzyxg9AnLiL1NoBW27Kd3ZcX3i1BHKr8c--qOyxbz8DtUyIzkJGcOq79wIQZRnDCr1_xPo6EhzOi59TlEIfJhzR4qfgLm3tlgK8zDaUY5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kNfMV9zaWdudXBzaWduaW4xIiwiY19oYXNoIjoiOU1Oc2k5b05KQzZYWjRVSkFvS0N6dyJ9.RckgULrCBdXzw-7-VYgmB7k0Ghfg1jRMsJF8_1oxLbNXTOcZDe9grbJKcpWoesHp5L5_bVfAa1HQOFzMlmPwPPvM0a2yl1zT8UQzJ_a8W4EHkA4Ao3Xt3osbjoBhRh65Nu4fCVGHswPgxZNAR_N7jr4pR6Pf4PllmKpne-bw7onz_HjpT4ulyyq8jNZye3YokPZh0ha9LaV_19NiwfnVAR451lqfugKs2DWfseXbyGlOnjFCl_UHQDOxa1_ZUTmvF1JUgff2VAOmW2925RMQopzfDjCUEvwZMLr8pKTystErvUR6a8itRAKIFwbfEh3en8PqBun9T89-5qKmmN4NTQ&client_secret=h888Q~Jlg97L2ngl6GHpaKqS6FmkLygeTVY7Eb-h
I tried to search the error message but only get two discussion threads in Stackoverflow, however no useful info found.
https://stackoverflow.com/search?q=AADB2C90090%3A+The+provided+JWE+is+not+a+valid+5+segment+token.
I tried to reproduce the same in my environment and got the same error as below:
To generate the access token, ID token and code in the browser I used the below parameters:
GET https://Tenant.b2clogin.com/Tenant.onmicrosoft.com/B2C_1_testuserflow/oauth2/v2.0/authorize?
client_id=37cd7fca-ea8f-4300-XXXX-XXXXXXXXXX
&response_type=code+id_token
&redirect_uri=https://jwt.ms
&response_mode=fragment
&scope=openid
&state=12345
The error usually occurs if you pass invalid code value. To resolve the error, make sure to copy only the code value not with id token.
I am able to call /token to refresh the token successfully like below:

Access Token Does Not Generate PHPmailer

i am using phpmailer i have generated client id and client secret key. When click on link
https://toplinetalent.co.nz/vendor/phpmailer/phpmailer/get_oauth_token.php
Getting error: This page isn’t working toplinetalent.co.nz is currently unable to handle this request.
HTTP ERROR 500

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

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).

How to configure Code value from Azure platform 'AADSTS900144'

Whenever i connect Azure platform from my platform & access for Authorization getting an error like the following
Authorization failed with the error message, 'AADSTS900144: The
request body must contain the following parameter: 'code'. Trace ID:
0c2a6ce5-a127-491f-8ef5-34b4b0f11a00 Correlation ID:
5ae207ac-ff51-43da-92a6-0225372c55b1 Timestamp: 2020-10-06 11:19:33Z'
Similarly faced scope value exception.Refered the link AADSTS900144: The request body must contain the following parameter: 'scope' when using legacy Developer Portal
Now, How to fetch the code value Azure platform?
Code will be provided in the response of the authorization request. Once obtained you will include it in the token request as detailed in Request an access token.
According to your error message, you are missing request parameters when requesting an access token. You need to put the following parameters in the request body:
For code, it needs to be acquired by interactive login users, you need to execute the following request in the browser to acquire it:
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&response_mode=query
&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fmail.read
&state=12345

Microsoft Bot Framework and Slack - always returning Forbidden when testing

I've registered a bot and write a demo with MS bot and LUIS.I also hosted it in azure and got a https endpoint like
https://$team***plus:t27oCcSM0b85uzQhl2bg2W****KQAbe8yyjojegY4HrMvs#teambotplus.******eweb****et/deploy ,
and I paste it like https://$team***plus:t27oCcSM0b85uzQhl2bg2W****KQAbe8yyjojegY4HrMvs#teambotplus.******eweb****et/deploy/api/messages
However,when typed the Test button ,I just got :
enter image description here
It's also added in slack channel,and returned nothing after I send a message.
Three messages from slack channel issues
*POST to luckybot failed: POST to the bot's endpoint failed with HTTP status 403
*There was an error sending this message to your bot: Forbidden
*There was an error sending this message to your bot: Forbidden
The https endpoint should looks like https://YourWebAppName.azurewebsites.net/api/messages and that's the URL you should put in your Bot's configuration page.

Resources