Code Monkey home page Code Monkey logo

oauth2-tester's People

Contributors

sedovalx avatar

Watchers

 avatar  avatar

oauth2-tester's Issues

Styling for the request/response block

Now it is a JSON in the <pre> tag. But it should be possible to create a markup for
Request:

  • method
  • uri
  • query parameters
  • headers (optional)
  • body (optional)

Response:

  • status
  • protocol version
  • headers (optional)
  • content type (from headers)
  • body (optional)

Error:

  • message
  • error type
  • error message

Frontend should aks backend for flow types

Flow types should be declared on the backend. It should return them on request. On the other hand frontend should keep the current flow type in the local state and give a user a posibility to select a flow type from the setting dialog.

CRUD for servers

It should be possible to

  • List all saved servers info (names).
  • Add new server info: name, authorization and token endpoints, client id and secret.
  • Edit server info
  • Add new server

Server identity is his name. Should be single save server operation for editing and adding.

Authorization code accept client route

Client application should has a 'callback' route for accepting the code in the uri query params.

  • Find out the target server. From the document.referrer?
  • The code should be saved in the client's server info.
  • Button for run the exchanage code for token command should be enabled

Get auth token from the server response

When the client do the auth request via the server it should await the token in the response body:

{
  response: {
    body: {\"access_token\":\"35a70395cea0670c15373e8a05e1e977b3aff913\",\"token_type\":\"bearer\",\"scope\":\"user\"}"
  }
}

Suggestion URI for a OAuth Server

When a user are browsing the servers the suggested uri should be built. It should depends on

  • current server
  • current flow type
  • presence of the token for the server
  • presence of a auth code for the server
  • username/password

User should be able to edit the suggested request in the request editor.

Show previous request on the startup

If the client application on the startup finds the auth code and the state in the URI it should try to restore previous request from the local storage and build request/response.

Создать доменную сущность сервера OAuth 2.0

Должна уметь сохранять следующие поля:

  • Client ID строка
  • Client Secret строка
  • Authorization endpoint строка
  • Token endpoint строка

Какой-либо привязке к текущему пользователю наверное не нужно.
Возможно потом привязать историю запросов.

Backend should has a route for handling redirect_uri

Backend should has the base route for handling callback errors. Important point: the registered callback address should be the base address for auth code callback and for the token callback.

  • GET /callback?code= - redirect to the frontend (payload: code & referrer?)
  • GET /callback?error= - redirect to the frontend (payload: error & referrer?)
  • GET /callback?access_token= - should complete the frondend "exchangeAuthCode" request #7 with token
  • POST /callback + { access_token } - should complete the frondend "exchangeAuthCode" request #7 with error
  • POST /callback + { error } - should complete the frondend "exchangeAuthCode" request #7 with error

Should store the auth code in the server

Each server can has a code and token. But for now it only possible to store just one that is parsed from the uri at the app start. Application should find proper server and store the code and token in it.

Server controller for delegation of the client requests

Should be a backand controller for executing client requests to an Internet resource. The controller should proxy client requests with preserving headers, body, method and uri of the original request. It should return the original request and the response object to the client. We need to define data contract for such a response:

  • response object
  • request object
  • possible error while trying to execute the request (network and etc.)

Operation for exchanging the auth code for token

Front end should call backend operation to start exchange process. Add server method to exchange authorization code for access (and refresh) token.
Input:

  • authorization code
  • server name

Output:

  • access token
  • refresh token (?)
  • request info
  • response info

Frontend should pass in an authorization code obtained on the previous step. The backend handler for the client request should

  • get the server info by name
  • build and call the token acquire uri

TOKEN_ENDPOINT?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=CALLBACK_URL

  • wait until the API answer on the callback uri #8
  • response with token or error message and api request/response

Token info has the format:

{
    "access_token":"ACCESS_TOKEN",
    "token_type":"bearer",
    "expires_in":2592000,
    "refresh_token":"REFRESH_TOKEN",
    "scope":"read"
}

with possible additional fields.

Saving of a new server

Should store server info:

  • Name
  • Authorization Endpoint
  • Token Endpoint
  • Client ID
  • Client Secret

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.