#PKCE - New User

11 messages · Page 1 of 1 (latest)

cerulean forge
#

Hello,

I'm planning to implement the PKCE flow for helping users "connect" their OpenRouter account to my app.

Question: what happens if the user does not yet have an OpenRouter account? Will they be guided to create the account and then redirected back with the challenge code?

Or is there a chance they "fall off" during this PKCE flow if they have to create an account?

Thank you.

zenith linden
#

They’ll be guided to create an account!

cerulean forge
#

F yea! Thanks Alex. That’s smooth. Appreciate a good product. 😉

cerulean forge
#

@zenith linden Sorry I should have asked this sooner.

When using PKCE to obtain an API key, is that key permanent? Or is it only useful for the duration of the session (or some time limit)?

zenith linden
#

It's useful forever, as long as the credits don't pass the limit set by the user

#

(There might be a default expiration time placed on them in the future, for safety reasons)

cerulean forge
#

Good to know.

What I'm looking to do is use PKCE to make it easy for users to "connect" their API key into my app.

Right now we're asking them to go to their keys page, copy, then come back to paste.

As you can imagine, many users drop off there--so making it as easy as clicking a button is ideal.

But if the key will expire, that could lead to more issues. Hmm... 🤔

The CISSP certified cybersecurity expert in me totally understands this. The developer side of me is worried users won't "get it." 🙂

icy merlin
#

Thanks for the feedback! Agreed about the user friction. We will definitely do a few announcements and make sure all devs are aware if we do add the expiration on api keys.

cerulean forge
#

@icy merlin Thank you.

Question. I implemented the PKCE flow, but when the user clicks the "connect with OpenRouter" button and are directed to OpenRouter... it says "AAVI Minimal is requesting to use your models."

How can I change that to show my app name there?

I didn't see anything about it in the docs.

icy merlin
#

@cerulean forge it looks like you were using localhost to test, thats why the name showed up. When you use a real domain name we will use the AppTitle associated with that app or a genric title "An app".

To create an app with a title in our database you just have to make a chat/completions request with the referrerTitle and referrerUrl set. Check the request in the quick start docs.

OpenRouter

LLM router and marketplace

cerulean forge