Skip to content

Conversation

AdamWozniewski
Copy link

Updating dependency packages for internal async-auth examples

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 3b15c71 to 894201e Compare September 17, 2025 10:47
@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 894201e to 3a4a893 Compare September 18, 2025 11:45
@priley86
Copy link
Contributor

I was able to validate the asynchronous-authorization/langchain-next-js example to be working inside of #11 yesterday.

I think we should possibly rebase it here after. A couple more things:

  • would be nice to ensure that all bun.lock / package-lock.json's are updated. I think repo has primarily used bun.lock.
  • would be nice to reflect async auth style params introduced in: https://github.com/auth0-lab/auth0-ai-js/pull/270/files (JS examples). Not sure if we had these w/ python examples?
  • maybe we want to add a comment or something indicating about requestedExpiry setting coming soon (and now supported)?

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch 3 times, most recently from e78eac3 to 6bf1707 Compare September 24, 2025 10:37
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
./package-lock.json

Choose a reason for hiding this comment

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

Why was this file added to .gitignore (but the package-lock.json file is still under version control)?

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch 3 times, most recently from 7fd8e99 to 150ef82 Compare September 25, 2025 11:22
@auth0-samples auth0-samples deleted a comment from onthespotimmie Sep 25, 2025
@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch 2 times, most recently from bbe2d29 to b365c2f Compare September 30, 2025 10:31
@priley86
Copy link
Contributor

priley86 commented Sep 30, 2025

tested a few changes today locally for the asychronous-authorization/langchain-next-js example, and pushed a sample commit after here:
33f16fe

quick summary of changes made:

  • downgraded tailwind 4 back to tailwind 3 after noting rendering/next build issues
  • added FGA env to .env.example, as i was seeing it referenced in the example within asynchronous-authorization/langchain-next-js/src/lib/fga/fga.ts
  • updated prompt to force json when passing tool args
  • adopted sample nextjs-sdk middleware.ts
  • added comment about requestedExpiry. Note that if you do not provide this param w/ >=301 (s), you will have to have Guardian enrolled for your user. If provided as 301 (or greater), you will see email notifications by default (as long as the CIBA w/ Email feature is enabled on your tenant).

screenshots:

(working after using CIBA + Email approval)
Screenshot 2025-09-30 at 6 34 24 PM

(failure if user is not enrolled in Guardian, and requestedExpiry is not >= 301)
Screenshot 2025-09-30 at 6 44 07 PM

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch 2 times, most recently from f76341f to 596879f Compare October 1, 2025 09:57
@priley86
Copy link
Contributor

priley86 commented Oct 2, 2025

should be rdy to go after...

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 596879f to 1c768df Compare October 2, 2025 09:48
@AdamWozniewski
Copy link
Author

@priley86 @deepu105 Updated according to your instructions

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 091f0e1 to 9703b70 Compare October 4, 2025 16:10
# FGA_CLIENT_SECRET=<your-fga-store-client-secret>
# FGA_API_URL=https://api.xxx.fga.dev
# FGA_API_AUDIENCE=https://api.xxx.fga.dev/
# FGA_API_TOKEN_ISSUER=auth.fga.dev
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


// write the relationship tuples to FGA
await addRelation(user.email, document.id);
await addRelation(user.sub, document.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

all user.sub references can be reverted in this file (please just inspect diff here when applying)

retriever: vectorStore.asRetriever(),
buildQuery: (doc) => ({
user: `user:${user?.email}`,
user: `user:${user?.sub}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

user.email

user: `user:${user?.sub}`,
object: `doc:${doc.metadata.documentId}`,
relation: 'can_view',
relation: 'owner',
Copy link
Contributor

Choose a reason for hiding this comment

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

can remain can_view it seems

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 9703b70 to e601d4a Compare October 6, 2025 07:28
@AdamWozniewski
Copy link
Author

@priley86 Thanks for your comments, especially at this late hour.
I've made the corrections you suggested.

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from e601d4a to e6507bf Compare October 7, 2025 07:45
AdamW and others added 6 commits October 7, 2025 09:47
update package.json for ver5
feat: update passthrough quickstart examples

feat: update passthrough quickstart examples auth0-samples#2
update package.json for ver5
@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch 2 times, most recently from 60639bd to 7a75e1d Compare October 7, 2025 10:50
priley86
priley86 previously approved these changes Oct 7, 2025
@priley86 priley86 requested a review from deepu105 October 7, 2025 13:06
})
.from(documentsTable)
.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.email])))
.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.sub])))
Copy link
Contributor

@priley86 priley86 Oct 7, 2025

Choose a reason for hiding this comment

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

.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.email])))

Copy link
Author

Choose a reason for hiding this comment

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

@priley86 I think that was last thing to change

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from 7a75e1d to a492190 Compare October 8, 2025 07:04
deepu105
deepu105 previously approved these changes Oct 8, 2025
# Database configuration
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/ai_documents_db"

# Auth0 FGA
Copy link
Contributor

Choose a reason for hiding this comment

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

Not having this should not cause startup failures, atleast has never caused any startup failures for me so far. We probably should just remove the FGA stuff from this sample. when I did the sample originally I wasnt planning on these becoming the core of the quickstart and in tended this as ajusta reference app thats why I didnt remove those

const credentials = getCIBACredentials();
const accessToken = credentials?.accessToken;
const credentials = getCIBACredentials();
if (credentials?.accessToken) headers.Authorization = `Bearer ${credentials.accessToken}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

why make this file less readable? I don't see wht this reformatting was needed?


```sh
npm install
bun install
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep npm install as thats more widely used and available by default

Copy link
Author

Choose a reason for hiding this comment

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

@deepu105 Hi. I changed the README and .env.example files as per your suggestion regarding the file:
asynchronous-authorization/vercel-ai-next-js/src/lib/tools/shop-online.ts
Personally, I really like using template strings, but I have no objection to bringing back string concatenation.

Copy link
Contributor

Choose a reason for hiding this comment

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

My comment wasn't about that; it was about reformatting the file in a way that a lot of stuff became single-line, etc. The use of single line conditions in JS were discouraged in most popular formatting tools.

@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from a492190 to f0d7875 Compare October 8, 2025 09:37
@AdamWozniewski AdamWozniewski force-pushed the auth0-samples-update-node-next-langchain branch from f0d7875 to 2c8000a Compare October 8, 2025 11:44
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.

5 participants