Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Is clientName working? #693

Open
danielbakas opened this issue Oct 13, 2022 · 7 comments
Open

Is clientName working? #693

danielbakas opened this issue Oct 13, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@danielbakas
Copy link

danielbakas commented Oct 13, 2022

Search terms you've used

  • clientName
  • sessionId

Bug description

  • Setting clientName or sessionId in either SessionProvider or LogInButton doesn't change the app's name during Login

Expected result

  • I am looking for something similar to Penny's

image

Actual result

  • I get a random uuid, instead

image

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

@danielbakas danielbakas added the bug Something isn't working label Oct 13, 2022
@jeswr
Copy link
Contributor

jeswr commented Oct 13, 2022

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

@danielbakas
Copy link
Author

Thank you so much @jeswr. Worked like a charm!

@danielbakas
Copy link
Author

danielbakas commented Oct 13, 2022

Oh wait. I closed the issue, but it's still a bug isn't it? Passing clientName as a prop doesn't work

@danielbakas danielbakas reopened this Oct 13, 2022
@ThisIsMissEm
Copy link
Contributor

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

@ThisIsMissEm
Copy link
Contributor

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

@danielbakas
Copy link
Author

Yup. That fixed it. Also I created a cliendID.json file using the resource you shared:

Everything works perfect now. Thank you @ThisIsMissEm!!

@NSeydoux
Copy link
Contributor

We are now deprecating the React SDK, so we will not be addressing the open issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants