Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$150] Auth flow changes #344

Closed
jmgasper opened this issue Sep 30, 2020 · 17 comments
Closed

[$150] Auth flow changes #344

jmgasper opened this issue Sep 30, 2020 · 17 comments

Comments

@jmgasper
Copy link
Collaborator

@afrisalyp - We're working on some auth flow changes and could use some help. We've started work here:

#340

Basically, we're going to move from the "old" auth flow and HS256 token, to the "new" auth flow and RS256 token instead.

From Topcoder:

Logout and refresh are not working. Also code clean-up is required for decode and refresh logic. If possible lets use this lib - https://github.com/topcoder-platform/tc-auth-lib

The logout URL should look like:

https://accounts-auth0.topcoder-dev.com/?logout=true&retUrl=https%3A%2F%2Fx.topcoder-dev.com%2F

Topcoder provided this for reference:

appirio-tech/connect-app#4082

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30144220 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30144220 has been updated - it has been assigned to afrisalyp.

This is an automated message for ghostar via Topcoder X

@afrisalyp
Copy link
Collaborator

@jmgasper

Should I use feature/Auth0-RS256-Token branch?

@jmgasper
Copy link
Collaborator Author

@afrisalyp - Sure, thanks.

@afrisalyp
Copy link
Collaborator

@jmgasper

I got this error after started the topcoder-x-ui backend service.
I've tried to use babel, but still the same.
Any steps that should I do to use tc-auth-lib?

/home/afrisalyp/topcoder/topcoder-x/topcoder-x-ui/node_modules/@topcoder-platform/tc-auth-lib/src/connector-wrapper.js:10
export function configureConnector({connectorUrl, frameId, mockMode, mockToken}) {
^^^^^^

SyntaxError: Unexpected token export
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Module._compile (/home/afrisalyp/topcoder/topcoder-x/topcoder-x-ui/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.newLoader [as .js] (/home/afrisalyp/topcoder/topcoder-x/topcoder-x-ui/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/afrisalyp/topcoder/topcoder-x/topcoder-x-ui/node_modules/@topcoder-platform/tc-auth-lib/index.js:1:47)

@jmgasper
Copy link
Collaborator Author

jmgasper commented Oct 1, 2020

@sachin-maheshwari ☝️ Any ideas?

@sachin-maheshwari
Copy link

sachin-maheshwari commented Oct 1, 2020

@jmgasper some ES6 standards are making that cause. I handled this through "esm" like - https://github.com/topcoder-platform/topcoder-x-ui/blob/feature/Auth0-RS256-Token/package.json#L14 . You can handle in different ways.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Oct 4, 2020

@afrisalyp - I deployed these changes to https://x.topcoder-dev.com. I'm not seeing the logout working. Can you double check please?

@sachin-maheshwari - Can you have a look as well and let me know what you think please? We'll still need to update with the new login flow.

@afrisalyp
Copy link
Collaborator

@jmgasper

Do you see screen like this?
It seems we need to fix some configuration in auth0.

I got this error message

invalid_request: The "returnTo" querystring parameter "http://topcoderx.topcoder-dev.com/#!/app/main" is not defined as a valid URL in "Allowed Logout URLs". To add a new URL, please do it here: https://manage.auth0.com/#/applications/BXWXUWnilVUPdN01t2Se29Tw2ZYNGZvH/settings

Screenshot from 2020-10-05 07-37-03

@sachin-maheshwari
Copy link

@jmgasper @afrisalyp check now. I changed in LONGIN_URL at aws end.

@sachin-maheshwari
Copy link

@jmgasper i don't think new "refresh token" changes working.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Oct 6, 2020

@sachin-maheshwari - Login URL change looks to be working. I'm going to create new tickets for the refresh token and central lib stuff.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Oct 6, 2020

Payment failed: [500]: Failed to get billing detail for the project.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

@afrisalyp - Sorry for the delay here. I'm hoping to get the billing code fixed ASAP.

@afrisalyp
Copy link
Collaborator

No problem. Thanks.

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30144220

This is an automated message for ghostar via Topcoder X

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants