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

[Spike] Token based authentication in API Explorer #2027

Closed
3 tasks done
dhmlau opened this issue Nov 13, 2018 · 13 comments
Closed
3 tasks done

[Spike] Token based authentication in API Explorer #2027

dhmlau opened this issue Nov 13, 2018 · 13 comments

Comments

@dhmlau
Copy link
Member

dhmlau commented Nov 13, 2018

Timebox to 5 days

Description / Steps to reproduce / Feature proposal

User experience

Go to API Explorer, login and set the token so that API Explorer can use the token for subsequent request.

Originated from #1035 (comment)

Acceptance Criteria

  • Investigate whether swagger ui support token based authentication
  • and what changes/workaround needed in order to make it work
  • create a list of follow-up tasks (user stories) describing changes we need to make in order to make token based authentication work in our API Explorer

References

@nabdelgadir nabdelgadir changed the title Token based authentication in API Explorer [Spike] Token based authentication in API Explorer Nov 20, 2018
@hacksparrow hacksparrow self-assigned this Jan 8, 2019
@hacksparrow
Copy link
Contributor

Conclusion: Swagger UI provides UI for setting the token, we don't have to create additional UI. Links to example and discussion - #2210 (comment).

@bajtos
Copy link
Member

bajtos commented Jan 8, 2019

I disagree with closing this story. A spike it's done when there is a list of follow-up stories describing what needs to happen next.

In this particular case, we need user stories describing changes that we need to make to enable token-based authentication in API Explorer rendered for LB4 applications. Based on the discussion in #2210, I think we will need to describe security schemas in the OAI spec generated for our apps, but that's something to figure out as part of this spike.

@lygstate
Copy link

lygstate commented Feb 8, 2019

when this got to be fixed

@jotamora
Copy link

Hello,

Anybody can said to me if there is someone working in that? If there is someone working, anybody knows, more less, when can be ready?

Thanks.

@shendkardevesh
Copy link

hi @bajtos,
i tried to set headers by @param.header.string('token') token?: string in controller which gives me option to enter token for a api, which get's set in header.
which in ui gives me -
image

doing this is a correct way or we need something exactly same as in swagger-ui.

@nflaig
Copy link
Member

nflaig commented Aug 5, 2019

Hi @shendkardevesh,

right now I also face the problem that the explorer is completely unusable for me because there is no option to set headers so I have to use Postman instead.

This looks like a good workaround but you would need to add @param.header.string('token') token?: string to every controller method which seems odd if you don't even use the token there.

Do you know if there is a way to just add this once somewhere and the input field shows up for every endpoint?

@hacksparrow
Copy link
Contributor

@shendkardevesh @nflaig refer to #2210 (comment).

@nflaig
Copy link
Member

nflaig commented Aug 5, 2019

@hacksparrow are there instructions on how to enable this for loopback 4 applications?

@hacksparrow
Copy link
Contributor

@nflaig the link I pasted above is all we have for now. It is more of a Swagger UI thing. It would help to have our own instruction, though.

@frbuceta
Copy link
Contributor

frbuceta commented Aug 29, 2019

Hi, I want to work on this feature (yes i am able)

My idea is to add securityScheme when registering a@loopback/authentication strategy and add security to the endpoints when the decoratorexample --> @authenticate('BasicStrategy')is defined

Any idea how I can do?

@dhmlau
Copy link
Member Author

dhmlau commented Sep 9, 2019

@frbuceta, @jannyHou has created a PR on the result of the spike. Could you please take a look? loopbackio/loopback4-example-shopping#267

@jannyHou
Copy link
Contributor

jannyHou commented Sep 13, 2019

Follow-up story created:

@jannyHou
Copy link
Contributor

Closed. See spike loopbackio/loopback4-example-shopping#267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants