Skip to content

feat: integrate oidc digest#76

Merged
matias-gonz merged 4 commits intofeat/oidc-account-recoveryfrom
oidc/digest
Feb 21, 2025
Merged

feat: integrate oidc digest#76
matias-gonz merged 4 commits intofeat/oidc-account-recoveryfrom
oidc/digest

Conversation

@matias-gonz
Copy link
Member

Description

Add nx to salt service
Generate oidc digest and save it

add nx to salt
integrate digest
add AUTH_SERVER_URL
Comment on lines +45 to +57
const response = await fetch("http://127.0.0.1:3003/salt", {
method: "GET",
headers: {
Authorization: `Bearer ${props.jwt.raw}`,
},
})
.then((res) => res.json())
.catch((e) => {
console.error(e);
});

const salt = response.salt;
const oidcDigest = new OidcDigest(props.jwt.iss, props.jwt.aud, props.jwt.sub, ByteVector.fromHex(salt)).serialize();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep it here or move it to /utils/salt.ts / /utils/oidcDigest.ts?


const app = express();

app.use(cors({ origin: env.AUTH_SERVER_URL }));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need any more origins or a default?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, let's be restrictive by default.

@github-actions
Copy link

github-actions bot commented Feb 21, 2025

Visit the preview URL for this PR (updated for commit 5176d8d):

https://zksync-auth-server-staging--pr76-oidc-digest-6wakmmoc.web.app

(expires Fri, 28 Feb 2025 15:10:07 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 509a9c9ea42583076f531c53cf2979c544d5d0b7

const { addOidcAccount, addOidcAccountIsLoading } = useRecoveryOidc();

if (props.jwt !== null) {
const response = await fetch("http://127.0.0.1:3003/salt", {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep a constant or use env?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote is to use the runtimeconfig inside nuxt.config.ts.

It can be then accessed using useRuntimeConfig.


const app = express();

app.use(cors({ origin: env.AUTH_SERVER_URL }));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, let's be restrictive by default.

const { addOidcAccount, addOidcAccountIsLoading } = useRecoveryOidc();

if (props.jwt !== null) {
const response = await fetch("http://127.0.0.1:3003/salt", {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote is to use the runtimeconfig inside nuxt.config.ts.

It can be then accessed using useRuntimeConfig.

move url to runtimeconfig
@matias-gonz matias-gonz merged commit 0c60a41 into feat/oidc-account-recovery Feb 21, 2025
4 checks passed
@matias-gonz matias-gonz deleted the oidc/digest branch February 21, 2025 15:15
cpb8010 pushed a commit that referenced this pull request Jul 16, 2025
* feat: add nx to salt

add nx to salt

* feat: integrate digest

integrate digest

* feat: add AUTH_SERVER_URL

add AUTH_SERVER_URL

* refactor: move url to runtimeconfig

move url to runtimeconfig
cpb8010 pushed a commit that referenced this pull request Jul 16, 2025
* feat: add nx to salt

add nx to salt

* feat: integrate digest

integrate digest

* feat: add AUTH_SERVER_URL

add AUTH_SERVER_URL

* refactor: move url to runtimeconfig

move url to runtimeconfig
cpb8010 pushed a commit that referenced this pull request Jul 16, 2025
* feat: add nx to salt

add nx to salt

* feat: integrate digest

integrate digest

* feat: add AUTH_SERVER_URL

add AUTH_SERVER_URL

* refactor: move url to runtimeconfig

move url to runtimeconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants