Code Monkey home page Code Monkey logo

hybrid-keyvault-java-manage-secrets-certificate-based-auth's Introduction

page_type languages products description urlFragment
sample
java
azure
This sample uses certificate based service principal authentication to work with Keyvaults.
Hybrid-KeyVault-Java-Manage-Secrets-Certificate-Based-Auth

Hybrid-KeyVault-Java-Manage-Secrets-Certificate-Based-Auth

This sample shows how to do the following operations of Key Vault with Key Vault SDK

  • Create a Key Vault using certificate based authentication
  • Create a secret inside the Key Vault
  • Get the secret
  • Delete the Resource Group

Running this Sample

To run this sample:

  1. Clone the repository using the following command:

    git clone https://github.com/Azure-Samples/Hybrid-KeyVault-Java-Manage-Secrets-Certificate-Based-Auth.git

  2. Create an Azure service principal and assign a role to access the subscription. For instructions on creating a service principal, see Use Azure PowerShell to create a service principal with a certificate.

  3. Export the service principal certificate as a pfx file.

  4. Set the following required environment variable values:

    • AZURE_TENANT_ID
    • AZURE_CLIENT_ID
    • AZURE_OBJECT_ID (To set access permissions for KeyVault. You can retrieve this value from the output during Service Principal Creation)
    • AZURE_CERT_SECRET
    • AZURE_CERT_PATH
    • AZURE_SUBSCRIPTION_ID
    • ARM_ENDPOINT
    • RESOURCE_LOCATION
  5. Change directory to Hybrid sample:

    • cd Hybrid-KeyVault-Java-Manage-Secrets-Certificate-Based-Auth
  6. Run the sample:

    • mvn clean compile exec:java

Use latest Key Vault SDK

The Key Vault secrets SDK here is com.azure:azure-security-keyvault-secrets, if you are using the latest version of the Key Vault SDK package, please refer to the following examples:

  • IdentityReadmeSamples.java shows multiple ways to authenticate the Key Vault client via DefaultAzureCredential, device code, client secret or certificate in addition to others.

  • HelloWorld.java - Examples for common Key Vault tasks:

    • Create a secret inside the Key Vault
    • Get the secret

More information

https://azure.com/java


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

hybrid-keyvault-java-manage-secrets-certificate-based-auth's People

Contributors

jongio avatar luyunmt avatar microsoftopensource avatar msftgits avatar v-rajagt-zz avatar viananth avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hybrid-keyvault-java-manage-secrets-certificate-based-auth's Issues

[Action Needed] This repo is inactive

This GitHub repository has been identified as a candidate for archival

This repository has had no activity in more than [x amount of time]. Long periods of inactivity present security and code hygiene risks. Archiving will not prevent users from viewing or forking the code. A banner will appear on the repository alerting users that the repository is archived.

Please see https://aka.ms/sunsetting-faq to learn more about this process.

Action

✍️

❗**If this repository is still actively maintained, please simply close this issue. Closing an issue on a repository is considered activity and the repository will not be archived.🔒

If you take no action, this repository is still inactive 30 days from today it will be automatically archived..

Need more help? 🖐️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.