solid-ui-react
solid-ui-react copied to clipboard
Is clientName working?
Search terms you've used
- clientName
- sessionId
Bug description
- Setting
clientName
orsessionId
in eitherSessionProvider
orLogInButton
doesn't change the app's name during Login
Expected result
- I am looking for something similar to Penny's

Actual result
- I get a random uuid, instead

Environment
Please run
npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers
in your project folder and paste the output here:
$ npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1 Pro
Memory: 645.81 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.9.1 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.19.2 - ~/Documents/Profesional/Semantyk/Projects/Semantyk/client/node_modules/.bin/npm
Browsers:
Chrome: 106.0.5249.103
Safari: 16.0
npmPackages:
@inrupt/solid-ui-react: ^2.8.1 => 2.8.1
@testing-library/jest-dom: ^5.16.5 => 5.16.5
@testing-library/react: ^13.4.0 => 13.4.0
@testing-library/user-event: ^13.5.0 => 13.5.0
bootstrap: ^5.2.1 => 5.2.2
buffer: ^6.0.3 => 6.0.3
install: ^0.13.0 => 0.13.0
npm: ^8.19.2 => 8.19.2
rdflib: ^2.2.20 => 2.2.20
react: ^18.2.0 => 18.2.0
react-bootstrap: ^2.5.0 => 2.5.0
react-dom: ^18.2.0 => 18.2.0
react-helmet-async: ^1.3.0 => 1.3.0
react-router-dom: ^6.4.1 => 6.4.2
react-scripts: 5.0.1 => 5.0.1
web-vitals: ^2.1.4 => 2.1.4
npmGlobalPackages:
npm: 8.19.1
Additional information
Try putting it in the authOptions
parameter for the LoginButton i.e.
<LoginButton
...
authOptions={{ clientName: "My App" }}
/>
That data is forwarded to the login function here https://github.com/inrupt/solid-ui-react/blob/5c2e99e16f0407ad82dbfcee11c1c4cecb73ba89/src/components/logIn/index.tsx#L47
Thank you so much @jeswr. Worked like a charm!
Oh wait. I closed the issue, but it's still a bug isn't it? Passing clientName
as a prop doesn't work
If you want to set even more data on the Consent screen, I'd recommend looking at Client Identifier Documents: https://docs.inrupt.com/developer-tools/javascript/client-libraries/tutorial/authenticate-client/
Then your client_id is a URL and you aren't using a dynamically registered client
sessionId
in SessionProvider is completely unused, we've, iirc, removed the ability to set it for security reasons.
clientName currently isn't passed through there for logging in, but:
const { login } = useSession()
// login button on click handler:
await login({ clientName: "test app", oidcIssuer: "https://login.inrupt.com" })
Should work though
Yup. That fixed it. Also I created a cliendID.json
file using the resource you shared:
- https://solid-client-identifier-helper.vercel.app/generator
Everything works perfect now. Thank you @ThisIsMissEm!!