Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Authorized" status not updating on oauth2 flow completion #2870

Closed
travisbrkr1234 opened this issue Apr 6, 2017 · 5 comments
Closed

"Authorized" status not updating on oauth2 flow completion #2870

travisbrkr1234 opened this issue Apr 6, 2017 · 5 comments

Comments

@travisbrkr1234
Copy link

travisbrkr1234 commented Apr 6, 2017

I am having a problem using the OAuth2 flow where the the "Authorized" status is never updated on completion of the oauth2 token grant. I am using the access_code(authorization_code) flow

My dup steps:

  • Instantiate new a new ui (SwaggerUIBundle)
  • Pass in my:
  • oauth2RedirectUrl
  • url
  • tokenUrl
  • Run 'npm run dev'
  • Click the "authorize" button
  • Type in my client id and secret
  • Check applicable scopes
  • Click Authorize, a new tab opens up for me to authenticate
  • Click allow application
  • Token is generated
  • I close the new tab
  • The "Authorize" button still exists, so I click it again
  • The screen flashes, and the "Authorize" button turns into "Logout", as well as the "Authenticated" status appears.
@travisbrkr1234 travisbrkr1234 changed the title "Authorized" status not updating on oath2 flow completion "Authorized" status not updating on oauth2 flow completion Apr 6, 2017
@MateuszKubuszok
Copy link

I have the same error. Additionally I can see that after the Logout button appears, the OAuth2 data is broken: the authorization header is "authorization: Bearer undefined".

I also have 3 other flows defined (application, implicit and password) and none of them works as well. I know that application flow is not supported and UI only display it, but implicit and password are broken for me:

  • when I click on the scopes to mark them, nothing happens, neither with the UI (checkbox is still not checked) nor int console log,

  • then I click authorize also nothing happens, but in the console I can see:

    Uncaught TypeError: t.map is not a function
        at c (http://localhost:8080/swagger3/swagger-ui-bundle.js:65:31141)
        at http://localhost:8080/swagger3/swagger-ui-bundle.js:65:31396
        at Array.reduce (native)
        at l (http://localhost:8080/swagger3/swagger-ui-bundle.js:65:31213)
        at Object.p [as mergeInQueryOrForm] (http://localhost:8080/swagger3/swagger-ui-bundle.js:66:220)
        at Object.fetch (http://localhost:8080/swagger3/swagger-ui-bundle.js:66:391)
        at http://localhost:8080/swagger3/swagger-ui-bundle.js:73:26827
        at Object.dispatch (http://localhost:8080/swagger3/swagger-ui-bundle.js:36:3829)
        at dispatch (<anonymous>:2:1507)
        at Object.authorizePassword (http://localhost:8080/swagger3/swagger-ui-bundle.js:29:15463)
    

For me workaround for those issues was a downgrade to Swagger UI 2.2.10. Versions from 3.0 onward seem to be broken to me.

@bodnia
Copy link
Contributor

bodnia commented Apr 21, 2017

@MateuszKubuszok can you please share the spec to reproduce this issue?

@MateuszKubuszok
Copy link

@bodnia
swagger.json.zip

I used mock-id and mock-secret to for accessing mock data.

I returned to check Swagger UI 3 today (API grew bigger in the meantime) and found out that it is pretty much not working due to #2923. I can prepare smaller example later on.

@bodnia bodnia closed this as completed in 374ac9c Apr 27, 2017
bodnia added a commit that referenced this issue Apr 27, 2017
@bodnia
Copy link
Contributor

bodnia commented Apr 27, 2017

@MateuszKubuszok @travisbrkr1234 can you please test the latest master and re-open the issue in case of any bugs. thank you

@MateuszKubuszok
Copy link

@bodnia It seems to work for me now, thanks!

dwasyluk added a commit to syscoin/swagger-ui that referenced this issue May 5, 2017
* swaggerui-master: (132 commits)
  enable configs plugin by default
  Rebuild dist
  fix swagger-api#2841
  Make the checkbox id more unique.
  Rebuild dist
  Fix swagger-api#3016
  removed semicolon
  preventDefault the form
  v3.0.8 (fixes swagger-api#2923 swagger-api#2889)
  Rebuild dist
  Increment swagger-client version
  Attach information to version object
  Fix swagger-api#3003
  updated searchbar sizing
  build
  remove object-assign dep ( which was missing from package.json )
  fix swagger-api#2870
  Fix typo in container classname
  fix eslint errors
  swagger-api#2844 fix accessCode flow
  ...

# Conflicts:
#	dist/swagger-ui-bundle.js
#	dist/swagger-ui-bundle.js.map
#	dist/swagger-ui-standalone-preset.js
#	dist/swagger-ui-standalone-preset.js.map
#	dist/swagger-ui.css
#	dist/swagger-ui.js
#	dist/swagger-ui.js.map
#	src/plugins/topbar/topbar.jsx
@lock lock bot locked and limited conversation to collaborators Jul 3, 2019
JuanSW18 pushed a commit to Digital-Paw/digital-paw-swagger-ui that referenced this issue Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants