Code Monkey home page Code Monkey logo

elvyauthorization.net's Introduction

ElvyAuthorization.NET

Elvy Authorization .NET SDK

Hoe werkt het:

De Elvy Authorization SDK is een .NET library die je kunt gebruiken om de Elvy token management voor je te laten doen. De library gebruikt je refresh token om automatisch access tokens aan te vragen bij de Elvy Licenser wanneer jij die nodig hebt.

Hoe gebruik je de SDK:

  • Stap 1: Download de SDK.

  • Stap 2: importeer het project in je .NET solution.

    • Voeg ook een referentie naar het project toe in je eigen project.
  • Stap 3: Voeg het volgende toe aan je appsettings.json:

    "ElvyRefreshToken": "Vervang dit met je eigen refresh token"

  • Stap 4: Initialiseer met dependency injection de TokenStorage in je startup.cs.

    • Dit is mogelijk door de volgende lijn aan je ConfigureServices methode toe te voegen: services.AddSingleton(x => new TokenStorage("https://localhost:44386/v1/Token/Refresh", Configuration["ElvyRefreshToken"]));
  • Stap 5: Gebruik de geinjecteerde dependency in je controller.

    • Voeg het volgende toe aan de constructor van je controller: TokenStorage tokenStorage. In de meest basic vorm zou je controller er dan zo uit zien:
       private readonly TokenStorage _tokenStorage;
      
       public HomeController(TokenStorage tokenStorage)
       {
           _tokenStorage = tokenStorage;
       }
      
  • Stap 6: Gebruik de tokens.

    • Dit kan door de volgende code aan te roepen:
      ElvyAccessToken elvyAccessToken = _tokenStorage.GetAccessToken();
      HttpRequestMessage request = new(HttpMethod.Get, "Gewenste elvy product url");
      client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", elvyAccessToken.access_token);
      

elvyauthorization.net's People

Contributors

wesselottevangerelvy avatar

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.