Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 6a015ad

Browse files
author
Paul O'M
authored
change 'sed' sequence for Google OAUTH2, add 'good first issue' to CONTRIBUTING guide (#3933)
* correct 'sed' replace sequence and tidy-up Signed-off-by: Paul O'M <mahoney@uk.ibm.com> * Add 'good first issue' link for 1st-time contributors Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
1 parent 02ea0e0 commit 6a015ad

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In order to assist anybody starting from scratch, we have produced guides on set
3838

3939
Start with the [Step-by-step development environment setup](./contrib-notes/getting-started.md)
4040

41-
Everything installed and ready code? Great! Issues are tracked in GitHub, if you are looking for a place to start with the code then it might be worth tackling a [bug](https://github.com/hyperledger/composer/issues?q=is%3Aissue+is%3Aopen+label%3Abug) or look for those issues tagged with [*help wanted*](https://github.com/hyperledger/composer/issues?q=is%3Aissue+label%3A%22help+wanted%22).
41+
Everything installed and ready code? Great! Issues are tracked in GitHub, if you are looking for a place to start with the code then it might be worth tackling a [bug](https://github.com/hyperledger/composer/issues?q=is%3Aissue+is%3Aopen+label%3Abug) or look for those issues tagged with [*help wanted*](https://github.com/hyperledger/composer/issues?q=is%3Aissue+label%3A%22help+wanted%22) or [*good first issue*](https://github.com/hyperledger/composer/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) - the latter being a good issue for first-time contributors.
4242

4343
## License <a name="license"></a>
44-
Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the [LICENSE](LICENSE) file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.
44+
Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the [LICENSE](LICENSE) file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.

packages/composer-website/jekylldocs/tutorials/google_oauth2_rest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
layout: default
3-
title: Using OAUTH2.0 with a Composer REST server
3+
title: Using Google OAUTH2.0 with a Composer REST server
44
category: tutorials
55
section: tutorials
66
index-order: 308
77
sidebar: sidebars/accordion-toc0.md
88
---
99

10-
# Using OAUTH2.0 with a {{site.data.conrefs.full}} REST server
10+
# Using Google OAUTH2.0 with a {{site.data.conrefs.full}} REST server
1111

12-
This tutorial provides an insight into configuring the OAUTH2.0 authentication strategy (eg. for Google, Facebook, Twitter authentication providers etc) to authorize access to resources in a configured REST Server instance - and allow end users of a blockchain network to interact with a deployed smart contract/business network - the Commodity Trading network in this tutorial (an overview diagram is shown below - a more detailed diagram showing the authentication flow is shown further down). You will run the REST server in [multi user mode](../integrating/enabling-multiuser.html) and test interacting with the network as different blockchain identities, accessing resources through the REST APIs. Ideally, you will need to set up your own Google account / authorization scheme to do this (see appendix on the steps to do this - doesn't take long), or minimally, use the ID/metadata provided in this tutorial. Suffice to say, it uses {{site.data.conrefs.composer_full}} as the underlying blockchain network.
12+
This tutorial provides an insight into configuring the OAUTH2.0 authentication strategy (eg. for Google, Facebook, Twitter authentication providers etc) to authorize access to resources in a configured REST Server instance - and allow end users of a blockchain network to interact with a deployed smart contract/business network. An overview diagram is shown below, and a more detailed diagram showing the authentication flow is shown further down. You will run the REST server in [multi user mode](../integrating/enabling-multiuser.html) and test interacting with the sample Trade network as different blockchain identities, accessing resources through the REST APIs. Ideally, you will need to set up your own Google account / authorization scheme to do this (see appendix on the steps to do this - doesn't take long), or minimally, use the ID/metadata provided in this tutorial. Suffice to say, it uses {{site.data.conrefs.composer_full}} as the underlying blockchain network.
1313

1414
![Google Authentication and REST Server Overview](../assets/img/tutorials/auth/intro_diagram.png)
1515

@@ -76,7 +76,7 @@ docker build -t myorg/composer-rest-server .
7676

7777
The parameter given the –t flag is the name you want to give to this Docker image, this can be up to you to name - but for this guide the image will be called ‘myorg/composer-rest-server’.
7878

79-
You should see output similar to the following with the bottom 2 lines indicating it was 'Successfuly built':
79+
You should see output similar to the following with the bottom 2 lines indicating it was 'Successfully built':
8080

8181
```
8282
docker build -t myorg/composer-rest-server .
@@ -204,7 +204,7 @@ You should get confirmation that the connectivity was successfully tested. We're
204204
<h2 class='everybody'> Step 6: Create the REST server Administrator for the Composer REST server instance </h2>
205205

206206

207-
1. Create a REST Adninistrator identity `restadmin` and an associated business network card (used to launch the REST server later).
207+
1. Create a REST Administrator identity called `restadmin` and an associated business network card (used to launch the REST server later).
208208

209209
```
210210
composer participant add -c admin@trade-network -d '{"$class":"org.hyperledger.composer.system.NetworkAdmin", "participantId":"restadmin"}'
@@ -223,7 +223,7 @@ composer network ping -c restadmin@trade-network
223223
The one liner below will substitute the 'localhost' addresses with docker hostnames and create a new connection.json - which goes into the card of our REST administrator. We will also use this custom connection.json file for our 'test' authenticated user later on in the OAUTH2.0 REST authentication sequence, nearer the end of this tutorial. To quickly change the hostnames - copy-and-paste then run this one-liner (below) in the command line from the $HOME directory.
224224

225225
```
226-
sed -e 's/localhost:/orderer.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' < $HOME/.composer/cards/restadmin@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/restadmin@trade-network/
226+
sed -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' -e 's/localhost:/orderer.example.com:/' < $HOME/.composer/cards/restadmin@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/restadmin@trade-network/
227227
```
228228

229229
<h2 class='everybody'> Step 7: Launch the persistent REST server instance </h2>
@@ -287,7 +287,7 @@ composer card import -f jdoe.card
287287
2. Once again, because we will use this identity to test inside the persistent REST docker container - we will need to change the hostnames to represent the docker resolvable hostnames - once again run this one-liner to carry out those changes quickly:
288288

289289
```
290-
sed -e 's/localhost:/orderer.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' < $HOME/.composer/cards/jdoe@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/jdoe@trade-network
290+
sed -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' -e 's/localhost:/orderer.example.com:/' < $HOME/.composer/cards/jdoe@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/jdoe@trade-network/
291291
```
292292

293293
3. We need to export the card to a file - to use for importing elsewhere - ie the card that we will use to import to the wallet in our browser client - and therefore at this point, we can discard the initial business network card file for `jdoe`.
@@ -303,7 +303,7 @@ composer participant add -c admin@trade-network -d '{"$class":"org.example.tradi
303303
composer identity issue -c admin@trade-network -f kcoe.card -u kcoe -a "resource:org.example.trading.Trader#trader2"
304304
composer card import -f kcoe.card
305305
306-
sed -e 's/localhost:/orderer.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' < $HOME/.composer/cards/kcoe@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/kcoe@trade-network
306+
sed -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/peer0.org1.example.com:/' -e 's/localhost:/ca.org1.example.com:/' -e 's/localhost:/orderer.example.com:/' < $HOME/.composer/cards/kcoe@trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/kcoe@trade-network/
307307
308308
composer card export -f kcoe_exp.card -n kcoe@trade-network ; rm kcoe.card
309309
```

0 commit comments

Comments
 (0)