Skip to content

edgeflare/fabric-oidc-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OIDC/OAuth2 Proxy for Hyperledger Fabric Blockchain

fabric-oidc-proxy allows authenticating to Hyperledger Fabric blockchain using OIDC token. It gets, on behalf of OIDC tokenholder (humans, programs, etc), a membership (x509) certificate issued by Fabric CA, and signs transactions using their respective certificate.

fabric-oidc-proxy

Prerequisites

  • Hyperledger Fabric network. For quickstart, checkout our helm-charts)
  • OIDC/OAuth2 provider that allows to add custom claims (We're using ZITADEL)

Quickstart

go build -o fabric-oidc-proxy .
./fabric-oidc-proxy start --port=8080

Register and Enroll a user with the OIDC proxy

export FABRIC_PROXY_API=http://localhost:8080/api/v1
curl -X POST -H "authorization: Bearer $TOKEN" $FABRIC_PROXY_API/account/enroll

Interacting with the Hyperledger Fabric network

example using asset-transfer chaincode-as-a-service

export TX_URL=$FABRIC_PROXY_API/default/assetcc/submit-transaction
  • InitLedger
curl -H "authorization: Bearer $TOKEN" -X POST -d '{"name": "InitLedger","args": []}' $TX_URL
  • GetAllAssets
curl -H "authorization: Bearer $TOKEN" -X POST -d '{"name": "GetAllAssets","args": []}' $TX_URL
  • CreateAsset
curl -H "authorization: Bearer $TOKEN" -X POST -d '{"name": "CreateAsset","args": ["demo-id-01", "blue", "10", "Sam", "100"]}' $TX_URL
  • UpdateAsset
curl -H "authorization: Bearer $TOKEN" -X POST -d '{"name": "UpdateAsset","args": ["demo-id-01", "blue", "10", "Sam", "1000"]}' $TX_URL
  • DeleteAsset
curl -H "authorization: Bearer $TOKEN" -X POST -d '{"name": "DeleteAsset","args": ["demo-id-01"]}' $TX_URL

Releases

No releases published

Packages

No packages published