Strongloop Passport.js authentication - "Failed to obtain access token" - javascript

I'm trying to write an Express/Passport app that authenticates with a Github Enterprise server. This has required manually-editing the github-strategy for passport to point to the private enterprise API endpoints. No biggie there.
I'm using Strongloop to build the application, so I'm using the strongloop-passport-component integration.
As far as I can tell the app is configured properly, but on redirect, I get the following error message:
Loopback 500 InternalOAuthError: Failed to obtain access token at
Strategy.OAuth2Strategy._createOAuthError
(/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:370:17)
at
/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:166:45
at
/Users/Tom/Desktop/soundoff/node_modules/passport-github/lib/strategy.js:75:25
at
/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:177:18
at ClientRequest.
(/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:148:5)
at emitOne (events.js:90:13) at ClientRequest.emit
(events.js:182:7) at TLSSocket.socketErrorListener
(_http_client.js:262:9) at emitOne (events.js:90:13) at
TLSSocket.emit (events.js:182:7)
If I look at the github app settings, I can verify that the user successfully authenticated with the app. It just seems to fail to redirect the user to the redirect URI. aparrently it cannot find the access token?
The URL the user ends up on is something like http://0.0.0.0:3000/auth/github/callback?code=dceef2ffe07b5dbfa194 -- however, I expect them to end up on http://0.0.0.0:3000/auth/account.
What could be causing Loopback to not find the access token? Isn't it in the url ?code=?

Solution was to not use strongloop-passport-component, unfortunately. Developer has been unresponsive and doesn't look like this will be fixed.

It can fail to obtain the access token if the temporary token (here, dceef2ffe07b5dbfa194) is not valid.
It is possible that in your modified github-strategy, the second phase of the OAuth flow where the temporary token is exchanged for a final token, is not configured properly, most likely requesting main github api instead of your enterprise github api for token exchange

Related

ntlm auth failed with error STATUS_USER_SESSION_DELETED

I am using a Windows server to manage our files(read, write). To connect to that server I am using SMB2 npm module https://www.npmjs.com/package/smb2. Internally, this module uses the ntlm method to authenticate. While authenticating, I am getting the error STATUS_USER_SESSION_DELETED. Authentication process is given below:
it sends NEGOTIATE command
SESSION_SETUP command
SESSION_SETUP command with SessionId (this is where the error is thrown)
TREE_CONNECT command
There is already open issues regarding same with Repo, so, waiting for that as well but any lead would be helpful

Chatbot working on emulator but not working on Web Chat and Direct Line after publishing to Azure

When I try to deploy and test the bot on Azure I'm getting the following error in Web Chat: There was an error sending this message to your bot: HTTP status code InternalServerError. I also have error 502 in the browser console when I use Direct Line: https://directline.botframework.com/v3/directline/conversations/1Td3aCZWwMV92LyotjCNuT-eu/activities 502.
The bot works fine in the emulator.
Use: JavaScript,
Deployment Environment: Azure Bot Service.
MicrosoftAppId and MicrosoftAppPassword has been set correctly in the .env file.
I use Luis and Snowflake too.
Please let me know if there is any information which I can provide to help resolve my issue.
Thank you tinuCoder (sanatanCoder) · GitHub. Posting your suggestion as answer to help other community members.
To resolve this There was an error sending this message to your bot: HTTP status code InternalServerError error:
Make sure to update your password wherever required.
For example: WebAppBot --> Settings and App Service --> Application settings change the password
References: BotError : Failed to send activity: bot returned an error. httpStatusCode: 500 · Issue #4184 · microsoft/botframework-sdk · GitHub and uwp - Bot framework "bot generates an error, an HTTP 502 response ("Bad Gateway") " - Stack Overflow

FETCH ERROR : request to https://www.gstatic.com/firebasejs/releases.json failed, reason: unable to get local issuer certificate

I'm getting this error, while hosting my REACT-APP using firebase. Does anybody have an idea how to solve this issue?
I read somewhere about setting NODE_TLS_REJECT_UNAUTHORIZED to 0, but don't know exactly how to implement it.
Here's a snip of my terminal :-
Img-1
Img-2
I am using VS code, I'm getting this error while hosting my REACT app using firebase.

Firebase messaging in production

I have a project that works with FCM. On the localhost, every thing works fine and I get the token for FCM; but, in production, I get this error:
FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('https://myxdomain.com/firebase-cloud-messaging-push-scope') with script ('https://myxdomain/firebase-messaging-sw.js'): A bad HTTP response code (403) was received when fetching the script. (messaging/failed-service-worker-registration).
I'm deploying my app in an Apache server.
As mentioned here, you need to add firebase-messaging-sw.js file in correct folder. It may be something like this: /var/www/...

How use sipML5 in freeswitch - Media stream permission denied

I have a problem using sipML5 webphone for my freeswitch server.
The problem is that when I use sipML5 webphone in my localhost - works, but when I publish webphone and use another client, it registers on server but on call time has error
that the error is: Media stream permission denied
Can you assist why?
error screen
webRTC now needs ssl ...
you need to install a certificate of some kind, and setup accordingly.

Categories