Coder Social home page Coder Social logo

keygen-sh / example-cpp-user-authentication Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 155 KB

Example of authenticating as a user and interacting with Keygen's API

Home Page: https://keygen.sh

License: MIT License

C++ 100.00%
cpp17 curl-library software-licensing

example-cpp-user-authentication's Introduction

Example C++ User Authentication

This is an example C++ program for authenticating as a user and using a user token to interact with the API. It contains a small command line script that generates a new API token using the user's email and password, and then uses that token to retrieve the user's profile and to list the user's licenses.

Running the example

First up, add an environment variable containing your account ID:

# Your Keygen account ID
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"

You can either run each line above within your terminal session before starting the app, or you can add the above contents to your ~/.bashrc file and then run source ~/.bashrc after saving the file.

Next, on macOS, compile the source using g++:

g++ main.cpp -o bin.out \
  -std=c++17 \
  -stdlib=libc++ \
  -lcurl

Then run the bin:

KEYGEN_ACCOUNT_ID=demo ./bin.out

Running on other platforms

We are only including instructions on how to compile and run this example on macOS. If you'd like to create a PR with instructions for another platform, such as Windows or Linux, please feel free to open a PR.

Questions?

Reach out at [email protected] if you have any questions or concerns!

example-cpp-user-authentication's People

Contributors

ezekg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dwijmistry11

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.