{"id":23270505,"url":"https://github.com/bioid-gmbh/bwsclient-restgrpc-java","last_synced_at":"2025-08-21T03:31:58.882Z","repository":{"id":268685651,"uuid":"872336577","full_name":"BioID-GmbH/BWSClient-RestGrpc-Java","owner":"BioID-GmbH","description":"BWS 3: The BioID RestGrpcForwarder project is a Java Spring Boot application that receives RESTful calls and forwards these calls to the gRPC endpoint of the BioID Web Service 3.","archived":false,"fork":false,"pushed_at":"2024-12-18T09:15:57.000Z","size":42056,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-18T10:26:30.402Z","etag":null,"topics":["bioid","bws-3","grpc","java-spring-boot","restful"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BioID-GmbH.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-14T09:05:24.000Z","updated_at":"2024-12-18T09:16:02.000Z","dependencies_parsed_at":"2024-12-18T10:36:37.257Z","dependency_job_id":null,"html_url":"https://github.com/BioID-GmbH/BWSClient-RestGrpc-Java","commit_stats":null,"previous_names":["bioid-gmbh/bwsclient-restgrpc-java"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioID-GmbH%2FBWSClient-RestGrpc-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioID-GmbH%2FBWSClient-RestGrpc-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioID-GmbH%2FBWSClient-RestGrpc-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioID-GmbH%2FBWSClient-RestGrpc-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BioID-GmbH","download_url":"https://codeload.github.com/BioID-GmbH/BWSClient-RestGrpc-Java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230487779,"owners_count":18233862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioid","bws-3","grpc","java-spring-boot","restful"],"created_at":"2024-12-19T18:52:23.314Z","updated_at":"2024-12-19T18:52:23.907Z","avatar_url":"https://github.com/BioID-GmbH.png","language":"Java","readme":"# Java Spring Boot application for receiving RESTful calls for BioID Web Service gRPC API\n\n## Overview\n\nThe **BioID RestGrpcForwarder** project is a Java Spring Boot application that receives RESTful calls and forwards these calls \nto the gRPC endpoint of the BioID Web Service 3. \n\nThis approach allows you to utilize the advantages of gRPC (e.g. low latency and protocol buffer) while providing a \nRESTful API that is used by your client app(s).\n\nTo get a first impression of how our new biometric services work, you can try them out on our [BioID Playground][playground].\n\n## Technologies\n\n- Spring Boot\n- RESTful API\n- gRPC\n- Java\n\n## Project structure\n\nThe main source code of the project is located in the src/main/java/com/bws/restgrpcforwarder folder.\nThis is the standard project structure in a Spring Boot application.\n\n- `auth/` - Contains custom authentication handlers that manage user authentication and authorization.\n- `config/`\n  - `GrpcClientConfig` - The Java configuration class for gRPC API endpoint properties.\n  - `SecurityConfig` - It handles API key based authentication for the rest controller in the application. Currently set up for [LivenessDetection][liveness], [PhotoVerify][photoverify], and [VideoLivenessDetection][videoliveness].\n- `controllers/` - Contains the controllers for the REST API endpoints.\n- `datatypes/` - Data types represent the data structures with which the application works.\n- `grpc/` - Includes the configured gRPC clients with methods for communicating with the BWS API via gRPC, as well as a converter for transforming gRPC metadata into HTTP headers.\n- `security/` - Contains a utility class that generates JWT tokens with specified claims and expiration time, and applies these tokens to gRPC request metadata for authentication.\n- `RestGrpcApplication.java` - This is the main entry point of the application.\n- `/proto/` - Contains Protobuf definitions used for defining the data structures and bws service interfaces for gRPC communication.\n- `/resources/application.properties` - This file is for application-specific configurations in a Spring Boot app.\n\n## Get Started\n\nThis application works as a service and accepts RESTful requests, extracts e.g. input images (encoded as Base64 strings) from these requests,\nand converts them into byte arrays. These images as byte arrays are then sent to the BioID Web Service (BWS) gRPC endpoint using a gRPC client.\nThe response from the BWS is returned to this service via gRPC and then used as the response for the RESTful call.\n\nDepending on which gRPC API is used, additional parameters can also be transferred.\n\nIf you want to use your images or videos, you can convert them to or from a base64 encoded string using an online service like [base64.guru].\nThis service can handle conversions in both directions. Any other service can also be used for the conversion.\n\n\u003e [!IMPORTANT]\n\u003e Please use **base64** and not **base64url**.\n\n\u003e #### Before starting the service, follow these steps\n\u003e\n\u003e - You need a **BioID Account** with a **confirmed** email address. If you don’t have one, [create a BioID account][bioidaccountregister].\n\u003e - You can create a free [trial subscription][trial] of the BioID Web Service (BWS) once you've created your BioID account.\n\u003e - After you have signed in to the BWS Portal and created the trial subscription with the help of a wizard, you still need to create a BWS 3 client.\n\u003e - The client can be created with the help of a creation wizard.\n\u003e - If you have created a client, click on `Show client keys` to open the dialog box that displays the `ClientId` and `Keys` for your client.\n\n\u003e\n\u003e **The ClientId and Key will be explained in detail later on where to insert them.**\n\n### Installation\n\nIt is assumed that Java is already installed. You can verify this by typing `java --version` in the command line.\nA Maven wrapper is used in the project so that all necessary components are already included in the project.\n\n#### 1. Clone the repository\n\n- **Linux:**\n\n  ```bash\n  git clone https://github.com/BioID-GmbH/BWSClient-RestGrpc-Java.git\n  ```\n\n- **Windows:**\n\n  ```cmd\n  git clone https://github.com/BioID-GmbH/BWSClient-RestGrpc-Java.git\n  ```\n\n#### 2. Navigate to the project folder and build the java spring app\n\n- **Linux:**\n\n  ```bash\n  chmod +x mvnw\n  ./mvnw clean install\n  ```\n\n- **Windows:**\n\n  ```cmd\n  mvnw.cmd clean install\n    ```\n\n#### 3. Configure the application\n\nAdd your BWS gRPC clientId and key to the `/resources/application.properties` file to enable communication with our BWS. Refer to the instructions above to obtain these credentials. Set the `clientId` under `grpcApi.clientId` and the `access` key under `grpcApi.accessKey`. You can also configure the port on which the application runs by setting your port under `server.port=your port`.\n\n\u003e [!IMPORTANT]\n\u003e The BWS endpoint must be entered without **https://** under `grpcApi.endpoint` in application.properties.\n\n#### 4. Launch the application\n\n- **Linux:**\n\n  ```bash\n  ./mvnw spring-boot:run\n  ```\n\n- **Windows:**\n\n  ```cmd\n  mvnw.cmd spring-boot:run\n  ```\n\n### Example endpoints\n\n*The current version of the app includes three new BWS APIs: [LivenessDetection][liveness], [PhotoVerify][photoverify]\nand [VideoLivenessDetection][videoliveness].*\n\n###### To test our BWS APIs, you can use tools such as `Postman`.\n\n[base64.guru]: https://base64.guru/ \"Base64 String online converter\"\n[bioidaccountregister]: https://account.bioid.com/Account/Register \"Register a BioID account\"\n[trial]: https://bwsportal.bioid.com/ \"Create a free trial subscription\"\n[bwsportal]: https://bwsportal.bioid.com \"BWS Portal\"\n[liveness]: https://developer.bioid.com/bws/grpc/livenessdetection/ \"Presentation attack detection.\"\n[photoverify]: https://developer.bioid.com/bws/grpc/photoverify/ \"PhotoVerify\"\n[videoliveness]: https://developer.bioid.com/bws/grpc/videolivenessdetection/ \"Presentation attack detection in videos.\"\n[playground]: https://playground.bioid.com \"BioID Playground\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioid-gmbh%2Fbwsclient-restgrpc-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbioid-gmbh%2Fbwsclient-restgrpc-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioid-gmbh%2Fbwsclient-restgrpc-java/lists"}