LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
Star

Provider Registration

The service to support federated OAuth 2.0 providers.

For example, the external OAuth 2.0 provider is for external clients and the internal OAuth 2.0 provider for internal clients.

It is a federation protocol aimed at simplifying authorization and access to protected data by giving access to data while protecting the owner’s account credentials. It allows a user with an account on one website (the service provider) to allow another website (the consumer) to access his or her data from the first website.

This service has several endpoints and listens to port 6889.

specification.

openapi: 3.0.0
info:
  version: 1.0.0
  title: OAuth2 provider Registration
  license:
    name: MIT
servers:
  - url: 'http://light-oauth2.swagger.io'
paths:
  /oauth2/provider:
    post:
      summary: 'Registe a new oauth provider '
      operationId: createProvider
      requestBody:
        description: provider object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Provider'
      tags:
        - providers
      security:
        - provider_auth:
            - 'read:provider'
            - write.provider
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        '201':
          description: Null response
    put:
      summary: 'Update oauth provider '
      operationId: updateProvider
      requestBody:
        description: provider object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Provider'
      tags:
        - providers
      security:
        - provider_auth:
            - 'read:provider'
            - write.provider
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        '201':
          description: Null response
    get:
      summary: 'Return list of registed oauth provider '
      operationId: getProviders
      tags:
        - providers
      security:
        - provider_auth:
            - 'read:provider'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Provider'
        '201':
          description: Null response
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/oauth2/provider/{providerId}':
    delete:
      summary: delete a provider by providerId
      operationId: deleteProviderById
      tags:
        - providers
      parameters:
        - name: providerId
          in: path
          required: true
          description: The id of the provider
          schema:
            type: string
      security:
        - provider_auth:
            - 'read:provider'
            - 'write:provider'
      responses:
        '200':
          description: Expected response to a valid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  securitySchemes:
    provider_auth:
      type: oauth2
      description: This API uses OAuth 2 with the client credential grant flow.
      flows:
        clientCredentials:
          tokenUrl: 'https://localhost:6882/token'
          scopes:
            'write:provider': modify provider
            'read:provider': read provider
  schemas:
    Provider:
      required:
        - serverUrl
      properties:
        providerId:
          type: string
        serverUrl:
          type: string
        uri:
          type: string
        providerName:
          type: string
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string

/oauth2/[email protected]

This endpoint gets all the providers from the service.

/oauth2/[email protected]

This endpoint is used to create a new provider. The following validation will be performed before a new provider is created.

  • If providerId exists in the cache, it means the providerId has been registered, then the following error will be returned.
  "ERR12048": {
    "statusCode": 400,
    "code": "ERR12048",
    "message": "PROVIDER_ID_EXISTS",
    "description": "Provider id %s exists; It has been regristed already."
  }

/oauth2/[email protected]

This is the endpoint to update the existing provider. Before provider is updated, the following validation will be performed.

  • If providerId cannot be found in the service cache, then the following error will be returned.
  "ERR12049": {
    "statusCode": 404,
    "code": "ERR12049",
    "message": "PROVIDER_ID_INVALID",
    "description": "Provider id invalid."
  }

/oauth2/provider/{providerId}@delete

This endpoint is used to delete the existing provider. Before the provider is deleted, the following validations will be performed.

  • If serviceId cannot be found in the service cache, then the following error will be returned.
  "ERR12047": {
    "statusCode": 404,
    "code": "ERR12047",
    "message": "PROVIDER_ID_NOT_EXISTING",
    "description": "The provider id is not existing"
  }
  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Provider Registration” was last updated: April 5, 2021: Issue246 (#256) (50b1c10)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute