Giter Club home page Giter Club logo

skillsfundingagency.hmrc-apprenticeship-levy-api-stub's Introduction

SFA-DAS-HMRC-API-Stub

The App is a .Net Core 2.2 web application

This is a port of an existing stub application that can be found here: https://github.com/UKGovernmentBEIS/das-alpha-taxservice-mock To maitain backwards compatibility the same mechanism of token generation has been used

SFA-DAS-TaxService-Stub

The App is a .Net Core 2.2 web application

This is a port of an existing stub application that can be found here: https://github.com/UKGovernmentBEIS/das-alpha-hmrc-api-mock To maitain backwards compatibility the same mechanism of token generation has been used

API Documentation

The API is documented with Swagger and the OAuth via a .wellknown endpoint

Authorization

Authorization is by custom generated tokens that follow the OAuth2 Code flow. Swagger has been added to the SFA-DAS-HMRC-API-Stub project and the OAuth configuration can also be seen via the app using the /.well-known/openid-configuration URI

Example flow

Create a browser request to generate an access code:

GET: https://localhost:44360/oauth/authorize?client_id=28fHGKpDXKZwtQwSmaO3W9FwV0Ia&redirect_uri=http%3a%2f%2flocalhost%2fauth&response_type=code&scope=read:apprenticeship-levy

Once an access code is generated by successfully logging in via the SFA-DAS-TaxService-Stub website a request for an access token can be sent using a POST to:

https://localhost:44360/oauth/token

(the body is required to be x-www-form-urlencoded)

code:xxxxxxxxxxxxxxx client_id:xxxxxxxxxxxxxxxxxxx client_secret:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx redirect_uri:http%3A%2F%2Flocalhost%2Fauth grant_type:authorization_code

The call to this endpoint will return an access token that can then be used to authenticate against the SFA-DAS-HMRC-API-Stub project endpoints

Refresh token can be obtained by making POST request to https://localhost:44360/oauth/token

refresh_token:xxxxxxxxxxxxxxxx client_id:xxxxxxxxxxxxxxxxxxx client_secret:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx grant_type:refresh_token

Database Setup

The current implementation uses the existing mlab mongodb database

Config Setup (TBD)

N.B The project uses the configuration mechanism, however the das-employer-config project has not yet been updated

The configuration in use is the standard das AzureStorage setup. To install the config you will need to:

  1. Install the AzureStorage Emulator
  2. Clone the das-employer-config repo from GitHub
  3. Clone the das-employer-config-updater repo from GitHub
  4. Run the das-employer-config-updater project following the prompts (this will install the config into the AzureStorage Emulator)

skillsfundingagency.hmrc-apprenticeship-levy-api-stub's People

Contributors

dannygb avatar dscuffle avatar mariedale3 avatar witpo 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.