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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 #3876

Merged
merged 1 commit into from Oct 10, 2019

Conversation

@emonddr
Copy link
Contributor

emonddr commented Oct 4, 2019

Need to update this tutorial to make use of 'Authorize' button in API Explorer.

This capability was added by specifying certain OpenAPI security scheme settings in
the shopping cart application (see PR strongloop/loopback4-example-shopping#301).

Instead of using a REST client application to interact with endpoints that need a JWT token to be passed in an Authorization header in a request, the user can now use the API Explorer to do this.

Connected to #3740

Checklist

馃憠 Read and sign the CLA (Contributor License Agreement) 馃憟

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

馃憠 Check out how to submit a PR 馃憟

@emonddr emonddr requested review from bajtos and raymondfeng as code owners Oct 4, 2019
@emonddr emonddr changed the title docs: update 'try it out' section docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 Oct 4, 2019
@emonddr

This comment has been minimized.

Copy link
Contributor Author

emonddr commented Oct 4, 2019

Updated the try it out section.

@emonddr

This comment has been minimized.

Copy link
Contributor Author

emonddr commented Oct 4, 2019

Now I need to add a new section describing the steps we took in PR strongloop/loopback4-example-shopping#301 to make the Authorize button functionality work in the API Explorer. Forthcoming...

@emonddr emonddr force-pushed the dremond_openapi_auth_token_docs branch 4 times, most recently from f9f8ed7 to 950b659 Oct 4, 2019
@emonddr emonddr changed the title docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 [WIP] docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 Oct 7, 2019
@emonddr emonddr force-pushed the dremond_openapi_auth_token_docs branch 7 times, most recently from 2b939e9 to e335c21 Oct 7, 2019
@emonddr

This comment has been minimized.

Copy link
Contributor Author

emonddr commented Oct 7, 2019

Added a new section: Specifying the Security Settings in the OpenAPI Specification.

@emonddr emonddr changed the title [WIP] docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 docs: update tutorial on creating/registering a custom authentication strategy in LoopBack 4 Oct 7, 2019
Copy link
Contributor

agnes512 left a comment

Good writeup 馃憤

@emonddr emonddr force-pushed the dremond_openapi_auth_token_docs branch 4 times, most recently from c762f37 to f352c78 Oct 9, 2019
Copy link
Contributor

dhmlau left a comment

I've read the instruction but haven't tried it yet.

@@ -79,11 +79,11 @@ application, follow these steps:
Try http://[::1]:3000/ping
```

2. In a browser, navigate to [http://[::1]:3000](http://127.0.0.1:3000) or
1. In a browser, navigate to [http://[::1]:3000](http://127.0.0.1:3000) or

This comment has been minimized.

Copy link
@dhmlau

dhmlau Oct 9, 2019

Contributor
  • In the "view file", the number is correct, but maybe we should use the right numbering?
  • another nitpick: do we want to point user directly to API Explorer URL http://127.0.0.1:3000/explorer, instead of go to the root and click explorer. No strong opinion, just think this might be simpler.

This comment has been minimized.

Copy link
@emonddr

emonddr Oct 9, 2019

Author Contributor

In the "view file", the number is correct, but maybe we should use the right numbering?

I noticed that for numbered lists in MD format, you can specify 1. every time
so that is automatically renumbers for you. See https://www.markdownguide.org/basic-syntax/#ordered-lists .

Otherwise, we have to keep the numbering in proper order ourselves. Making them all 1. saves us the hassle.

This comment has been minimized.

Copy link
@emonddr

emonddr Oct 9, 2019

Author Contributor

another nitpick: do we want to point user directly to API Explorer URL http://127.0.0.1:3000/explorer, instead of go to the root and click explorer. No strong opinion, just think this might be simpler.

I guess I wanted them to see this screen:

image

also, when they execute : npm start is outputs

image

which tells them the server is starting at localhost:3000 ; and some users expect a home page for the server at that address.

I guess I wanted to show them there is a home screen, and they have two links to choose from.

This comment has been minimized.

Copy link
@emonddr

emonddr Oct 10, 2019

Author Contributor
@emonddr emonddr force-pushed the dremond_openapi_auth_token_docs branch from f352c78 to ea4ecee Oct 9, 2019
succeeds, the
[user profile](https://github.com/strongloop/loopback-next/blob/master/packages/authentication/src/types.ts)
1. Scroll to the top of the API Explorer, and you should see an `Authorize`
button. This the place where you can set the JWT token.

This comment has been minimized.

Copy link
@jannyHou

jannyHou Oct 10, 2019

Contributor

nitpick: This --> This is

Copy link
Contributor

jannyHou left a comment

LGTM in general, very detailed steps 馃憤

Can you also add a few note to explain that we have a plan to automatically bind the security spec (contributed by the authentication strategy) in story #3854 and #3669?

Update the authentication tutorial with OpenAPI specification
security scheme/requirement object declarations in order
to enable the 'Authorize' button/dialog functionality
in the API Explorer.
@emonddr emonddr force-pushed the dremond_openapi_auth_token_docs branch from ea4ecee to 4a67c48 Oct 10, 2019
@emonddr emonddr merged commit 4fb9f39 into master Oct 10, 2019
4 checks passed
4 checks passed
Travis CI - Pull Request Build Passed
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage remained the same at 91.841%
Details
@emonddr emonddr deleted the dremond_openapi_auth_token_docs branch Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can鈥檛 perform that action at this time.