{"id":28577610,"url":"https://github.com/mastercard/mastercard-idservice-idp-reference-app","last_synced_at":"2025-06-11T00:39:00.413Z","repository":{"id":65781681,"uuid":"536629746","full_name":"Mastercard/mastercard-idservice-idp-reference-app","owner":"Mastercard","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-15T14:25:16.000Z","size":109,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-16T10:43:18.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mastercard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2022-09-14T14:55:53.000Z","updated_at":"2024-04-16T10:43:18.031Z","dependencies_parsed_at":"2023-03-06T14:15:31.611Z","dependency_job_id":null,"html_url":"https://github.com/Mastercard/mastercard-idservice-idp-reference-app","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fmastercard-idservice-idp-reference-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fmastercard-idservice-idp-reference-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fmastercard-idservice-idp-reference-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fmastercard-idservice-idp-reference-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mastercard","download_url":"https://codeload.github.com/Mastercard/mastercard-idservice-idp-reference-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fmastercard-idservice-idp-reference-app/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259177340,"owners_count":22817349,"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":[],"created_at":"2025-06-11T00:38:33.371Z","updated_at":"2025-06-11T00:39:00.394Z","avatar_url":"https://github.com/Mastercard.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ID for Identity Providers Reference Implementation\n\n[![](https://developer.mastercard.com/_/_/src/global/assets/svg/mcdev-logo-dark.svg)](https://developer.mastercard.com/)\n\n[![](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)\n[![](https://sonarcloud.io/api/project_badges/measure?project=Mastercard_mastercard-idservice-idp-reference-app\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Mastercard_mastercard-idservice-idp-reference-app)\n[![](https://sonarcloud.io/api/project_badges/measure?project=Mastercard_mastercard-idservice-idp-reference-app\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=Mastercard_mastercard-idservice-idp-reference-app)\n[![](https://sonarcloud.io/api/project_badges/measure?project=Mastercard_mastercard-idservice-idp-reference-app\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Mastercard_mastercard-idservice-idp-reference-app)\n\n## Table of Contents\n- [Overview](#overview)\n  * [References](#references)\n- [Usage](#usage)\n  * [Prerequisites](#prerequisites)\n  * [Configuration](#configuration)\n  * [Integrating with OpenAPI Generator](#integrating-with-openapi-generator)\n  * [OpenAPI Generator Plugin Configuration](#openapi-generator-plugin-configuration)\n  * [Generating The API Client Sources](#generating-the-api-client-sources)\n  * [Build the Project](#build-project)\n  * [Test Case Execution](#test-case-execute)\n  * [Use Cases](#use-cases)\n  * [Execute the Use-Cases](#execute-use-cases)\n- [API Reference](#api-reference)\n  * [Authorization](#authorization)\n  * [Request Examples](#request-examples)\n  * [Client Encryption](#client-encryption)\n  * [Recommendation](#recommendation)\n- [Support](#support)\n- [License](#license)\n\n## Overview \u003ca name=\"overview\"\u003e\u003c/a\u003e\nID is a digital identity service from Mastercard that helps you apply for, enroll in, log in to, and access services more simply, securely and privately. Rather than manually providing your information when you are trying to complete tasks online or in apps, ID enables you to share your verified information automatically, more securely, and with your consent and control. ID also enables you to do away with passwords and protects your personal information. Please see here for more details on the API: [Mastercard Developers](https://developer.mastercard.com/mastercard-id-for-idp/documentation/).\n\nFor more information regarding the program, refer to [ID Service](https://idservice.com/)\n\n### References \u003ca name=\"references\"\u003e\u003c/a\u003e\n* [Mastercard's OAuth Signer library](https://github.com/Mastercard/oauth1-signer-java)\n* [Using OAuth 1.0a to Access Mastercard APIs](https://developer.mastercard.com/platform/documentation/using-oauth-1a-to-access-mastercard-apis/)\n* [Mastercard's Payload Encryption/Decryption library](https://github.com/Mastercard/client-encryption-java)\n* [Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/)\n\n## Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n### Prerequisites \u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n* [Mastercard Developers Account](https://developer.mastercard.com/dashboard) with access to ID for Identity Providers API\n* IntelliJ IDEA (or any other IDE)\n* [Spring Boot 2.2+ up to 2.7.x](https://spring.io/projects/spring-boot)\n* [Apache Maven 3.3+](https://maven.apache.org/download.cgi)\n* [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)\n* Set up the `JAVA_HOME` environment variable to match the location of your Java installation\n\n### Configuration \u003ca name=\"configuration\"\u003e\u003c/a\u003e\n1. Create an account at [Mastercard Developers](https://developer.mastercard.com/account/sign-up).\n2. Create a new project and add `ID for Identity Providers` API to your project.\n3. Download Sandbox Signing Key, a `.p12` file will be downloaded.\n4. In the Client Encryption Keys section of the dashboard, click on the 'Actions' dropdown and download the client encryption key, a `.pem` file will be downloaded.\n5. Select all `.p12` and `.pem` files, and copy them to `src/main/resources` in the project folder.\n6. Open `${project.basedir}/src/main/resources/application.properties` and configure below parameters.\n\n  \u003e**mastercard.api.base.path=** This base path, will be used as a host to make API calls. Change it corresponding to MC ID Service Url. For example `https://developer.mastercard.com/mastercard-id-for-idp/documentation/`.\n\n  \u003e**idp.userIdentifier=** This is the unique identifier which IDP provides upon authenticating an end-user. This value forms 'alias' claim in the JWT token to be generated by IDP while invoking Mastercard's\nIDP API endpoints. For more information on this unique identifier please refer at [Mastercard IDP API Reference app usage](https://developer.mastercard.com/mastercard-id-for-idp/documentation/reference-app/).\n\n  \u003e**server.port=** Application Port.\n\n   **Authentication**\n\n  \u003e**mastercard.api.key.file=** This refers to .p12 file found in the signing key. Please place .p12 file at src\\main\\resources in the project folder and add classpath for .p12 file.\n\n  \u003e**mastercard.api.consumer.key=** This refers to your consumer key. Copy it from \"Keys\" section on your project page in [Mastercard Developers](https://developer.mastercard.com/dashboard)\n\n  \u003e**mastercard.api.keystore.alias=** Alias of your key. Default key alias for sandbox is `keyalias`.\n\n  \u003e**mastercard.api.keystore.password=** Password of your Keystore. Default keystore password for sandbox project is `keystorepassword`.\n\n   **Encryption**\n\n  \u003e**mastercard.client.encryption.enable=** This parameter allows to encrypt the payload before send it to the server in case it's true.\n\n  \u003e**mastercard.api.encryption.certificateFile=** It contains the reference for the pem file certificate used by the client to encrypt payload, this file should be located at src/main/resources.\n\n  \u003e**mastercard.api.encryption.fingerPrint=** The fingerprint of the Mastercard public key used to encrypt the ephemeral AES key.\nmore information please refer at [Issuer-Initiated Tokenization](https://developer.mastercard.com/mdes-pre-digitization/documentation/use_case/issuer-tokenization/).\n\n  **Decryption**\n\n  \u003e**mastercard.client.decryption.enable=** This parameter allows to decrypt the payload.\n\n  \u003e**mastercard.api.decryption.keystore=** This is the password provided while creating the API project in [Mastercard Developers](https://developer.mastercard.com).\n\n  \u003e**mastercard.api.decryption.alias=** This is the keyalias user provided, that is used while creating the API project in [Mastercard Developers](https://developer.mastercard.com).\n\n  \u003e**mastercard.api.decryption.keystore.password=** This is the keyalias password provided, that is used while creating the API project in [Mastercard Developers](https://developer.mastercard.com).\n\n### Integrating with OpenAPI Generator \u003ca name=\"integrating-with-openapi-generator\"\u003e\u003c/a\u003e\n[OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) generates API client libraries from [OpenAPI Specs](https://github.com/OAI/OpenAPI-Specification).\nIt provides generators and library templates for supporting multiple languages and frameworks.\n\nSee also:\n* [OpenAPI Generator (maven Plugin)](https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin)\n* [OpenAPI Generator (executable)](https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli)\n* [CONFIG OPTIONS for java](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/java.md)\n\n### OpenAPI Generator Plugin Configuration \u003ca name=\"openapi-generator-plugin-configuration\"\u003e\u003c/a\u003e\n```xml\n\u003c!-- https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin --\u003e\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.openapitools\u003c/groupId\u003e\n    \u003cartifactId\u003eopenapi-generator-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${openapi-generator.version}\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003egenerate\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cinputSpec\u003e${project.basedir}/src/main/resources/mastercard-idservice-reference_api_spec.yaml\u003c/inputSpec\u003e\n                \u003cgeneratorName\u003ejava\u003c/generatorName\u003e\n                \u003clibrary\u003eokhttp-gson\u003c/library\u003e\n                \u003cgenerateApiTests\u003efalse\u003c/generateApiTests\u003e\n                \u003cgenerateModelTests\u003efalse\u003c/generateModelTests\u003e\n                \u003cconfigOptions\u003e\n                    \u003csourceFolder\u003esrc/gen/main/java\u003c/sourceFolder\u003e\n                    \u003cdateLibrary\u003ejava8\u003c/dateLibrary\u003e\n                \u003c/configOptions\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n### Generating The API Client Sources \u003ca name=\"generating-the-api-client-sources\"\u003e\u003c/a\u003e\nNow that you have all the required dependencies, you can generate the sources. To do this, use one of the following two methods:\n\n`Using IDE`\n* **Method 1**\u003cbr/\u003e\n  In IntelliJ IDEA, open the Maven window **(View \u003e Tool Windows \u003e Maven)**. Click the icons `Reimport All Maven Projects` and `Generate Sources and Update Folders for All Projects`\n\n* **Method 2**\u003cbr/\u003e\n\n  In the same menu, navigate to the commands **({Project name} \u003e Lifecycle)**, select `clean` and `compile`, then click the icon `Run Maven Build`.\n\n`Using Terminal`\n* Navigate to the project's root directory within a terminal window and execute `mvn clean compile` command.\n\n### Build the Project \u003ca name=\"build-project\"\u003e\u003c/a\u003e\nOnce you clone the project you must ensure that IntelliJ IDEA recognizes the folders. Go to\n**(file \u003e project structure \u003e modules)** and select the folder `src/main/java` as a source and `src/test/java` as test folder,\nalso check the language level at this configuration options and see if it's selected (8 - lambda type annotation etc.) following your java version\nadd also the Maven support in the Project tool window, right-click your project and select Add Framework Support.\n\n### Test Case Execution \u003ca name=\"test-case-execute\"\u003e\u003c/a\u003e\nNavigate to the test package and right click to  `Run All Tests`\n\n### Use cases \u003ca name=\"use-cases\"\u003e\u003c/a\u003e\n1. **RP Scopes**\n   - Retrieve the scopes and RP details associated with the arid. The ARID must be in PENDING status.\n2. **Scope fulfillments**\n   - Process the IDP claims and update the authentication request with the claims data.\n\nMore details can be found [here](https://developer.mastercard.com/mastercard-id-for-idp/documentation/use-cases/).\n\nGuides and tutorials can be found [here](https://developer.mastercard.com/mastercard-id-for-rp/documentation/tutorials-and-guides/).\n\n### Execute the Use-Cases \u003ca name=\"execute-use-cases\"\u003e\u003c/a\u003e\n1. Run `mvn clean install` from the root of the project directory.\n2. There are two ways to execute the user cases :\n   1. Execute the test cases\n        - At the `src/test/java` which is the main root folder for all Junit tests of the application.\n        - Run the tests.\n   2. Select the menu options provided by the application\n        - Run ```mvn spring-boot:run``` command to run the application.\n        - Once the application is running, you should be able to see and chose the follow three options :\n          - 0 Exit\n          - 1 RP Scopes\n          - 2 Scope-fulfillments\n        - The option 1 and 2 are going to ask for the ARID value in case you press enter the ARID value used is going to be the one found at the `application.properties` file. \n\n## API Reference \u003ca name=\"api-reference\"\u003e\u003c/a\u003e\nTo develop a client application that consumes the ID for Identity Providers API with Spring Boot, refer to the [ID for Identity Providers Reference](https://developer.mastercard.com/mastercard-id-for-idp/documentation/api-reference/).\n\n### Authorization \u003ca name=\"authorization\"\u003e\u003c/a\u003e\nThe `com.mastercard.dis.mids.reference.config` package will provide you API client. This class will take care of adding the correct `Authorization` header before sending the request.\n\n### Request Examples \u003ca name=\"request-examples\"\u003e\u003c/a\u003e\nYou can change the default input passed to APIs, modifying values in the following file: `com.mastercard.dis.mids.reference.constants.Constants`\n\n### Client Encryption \u003ca name=\"client-encryption\"\u003e\u003c/a\u003e\nThe public key your application uses to encrypt requests is listed under “Client Encryption Keys” on the Developer Dashboard.\nthis key file is linked at the [application.properties](./src/main/resources/application.properties).\nfor more information please go to [Payload Encryption](https://developer.mastercard.com/cross-border-services/documentation/api-ref/encryption/).\nWe also recommend reading Using Payload Encryption link at the References section at this document.\n\n### Recommendation \u003ca name=\"recommendation\"\u003e\u003c/a\u003e\nIt is recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.\n\n## Support \u003ca name=\"support\"\u003e\u003c/a\u003e\nIf you would like further information, please send an email to `apisupport@mastercard.com`\n- For information regarding licensing, refer to the [LICENSE](LICENSE.md).\n- For copyright information, refer to the [COPYRIGHT](COPYRIGHT.md).\n- For instructions on how to contribute to this project, refer to the [CONTRIBUTING](CONTRIBUTING.md).\n- For changelog information, refer to the [CHANGELOG](CHANGELOG.md).\n\n## License \u003ca name=\"license\"\u003e\u003c/a\u003e\nCopyright 2023 Mastercard\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercard%2Fmastercard-idservice-idp-reference-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastercard%2Fmastercard-idservice-idp-reference-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercard%2Fmastercard-idservice-idp-reference-app/lists"}