Giter VIP home page Giter VIP logo

sky-api-tutorial-auth-code-c-sharp's Introduction

.NET Core C# Authorization Code Flow Tutorial - SKY API

A demonstration of the authorization code flow within SKY API, implemented using .NET Core.

This code sample is a very basic example of how to interact with the Blackbaud OAuth 2.0 Service. You are free to choose the client library and method that best suit your needs when creating production-level applications.

Live demo:

View the demo app hosted on Microsoft Azure.

Run locally:

  • Download and install .NET Core SDK
  • Open Terminal/Command Prompt and type:
$  git clone https://github.com/blackbaud/sky-api-auth-tutorial-c-sharp.git
$  cd sky-api-auth-tutorial-c-sharp
  • Duplicate appsettings.json-sample as appsettings.Development.json and fill in the missing values (all required).
{
    "AppSettings": {
        "AuthClientId": "<Your developer app ID>",
        "AuthClientSecret": "<Your developer app secret>",
        "AuthRedirectUri": "http://localhost:5000/auth/callback",
        "AuthSubscriptionKey": "<Your developer subscription key>"
    }
}
  • Open Terminal/Command Prompt and type:
dotnet restore
  • On a Mac, type:
export ASPNETCORE_ENVIRONMENT=Development && dotnet run
  • On a PC, type:
set ASPNETCORE_ENVIRONMENT=Development && dotnet run
  • (PowerShell users may type:)
$Env:ASPNETCORE_ENVIRONMENT = "Development"

Visit http://localhost:5000/.

Deploy to Azure App Services:

  1. Login to Azure Portal and create a new App Service
  2. Under the app's Application Settings, add the following settings:
    `AppSettings:AuthClientId` Your registered application's Application ID
    `AppSettings:AuthClientSecret` Your registered application's Application Secret
    `AppSettings:AuthRedirectUri` The respective URI listed under your registered application's Redirect URIs
    `AppSettings:AuthSubscriptionKey` Your Blackbaud Developer Subscription Key
  3. Add a new deployment to point to a cloned version of this repository and sync.

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.