question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Totally insecure??

See original GitHub issue

I see this example in the docs:

const ui = SwaggerUIBundle({...})

// Method can be called in any place after calling constructor SwaggerUIBundle
ui.initOAuth({
    clientId: "your-client-id",
    clientSecret: "your-client-secret-if-required",
    realm: "your-realm",
    appName: "your-app-name",
    scopeSeparator: " ",
    additionalQueryStringParams: {test: "hello"}
})

clientSecret: “your-client-secret-if-required”,

Client secret? In the JS? That is sent to the user’s browser?

Can someone please explain to me how this could ever be secure? As far as I understand it, the client secret is meant for server-to-server communication, where the client secret is safe from prying eyes on the server. But if you are doing auth from the browser (as Swagger is doing) you should, AFAIK, never have a client secret in there.

I think we should remove this line from the docs. The client secret should never be used in combination with web-based apps. It’s for server-to-server communication.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Downloadcommented, Oct 22, 2017

@webron I think showing people how to shoot themselves in the foot isn’t wise. The client_secret should simply never be in an HTML page. Period. So why do we show it in an example?

1reaction
webroncommented, Jun 16, 2018

@Download Sorry for taking so long, but thanks for the advice. I’ve added a warning to it in the documentation, keep the feedback coming.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rockit Music – Total Insecurity Lyrics - Genius
Total Insecurity Lyrics: Don't misbehave, they're still untamed / Here to travel the night, can I live without light?
Read more >
How to Overcome Insecurity: Why Am I So Insecure?
I struggle with a lot of self identity/image issues. Writing it out, and facing these things was terribly emotional, but absolutely needed. Just...
Read more >
Totally Insecure Web Application Project (TIWAP) - GitHub
Totally Insecure Web Application Project (TIWAP). Contribute to tombstoneghost/TIWAP development by creating an account on GitHub.
Read more >
The 3 Most Common Causes of Insecurity and How to Beat ...
Perfectionism not only can cause insecurity, but depression, anxiety, eating disorders, and chronic fatigue as well. Stefano Tinti/Shutterstock.
Read more >
6 Signs of Insecurity in a Relationship - Brides
"You can be insecure in your relationship and absolutely be with the right person," Jeney explains. "You may just be self-sabotaging because ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found