Code Monkey home page Code Monkey logo

cognitoservice's Introduction

CognitoService

This service is creating using AWS API Gateway as well as AWS Lambdas and AWS Cognito. I would love to get it all working using CloudFormation but until then I will just doucment what I have working.

Endpoints

The context for the api currently is: https://t4o3pxu8dj.execute-api.us-west-2.amazonaws.com/dev

Authenticate Token

  • URL

/cognito/auth
Changed from /auth - currently both work but /auth will be removed in the future

  • Method: GET

  • Headers:
    Authentication: The access token provided by cognito.

  • Success Response:

    • Code: 200
      Content:
      {  
        "sub": "a993f745-d063-4321-ac6e-fd9a18f8b931",  
        "aud": "49f1foekljhlqn185fme63hi0s",  
        "cognito:groups": "admin,staging-manager",  
        "email_verified": "true",  
        "event_id": "280fba4a-f971-11e8-9419-c77846ddcac6",  
        "token_use": "id",  
        "auth_time": "1544112503",  
        "iss": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_8b6WpHm1z",  
        "cognito:username": "a993f745-d063-4321-ac6e-fd9a18f8b931",  
        "exp": "Thu Dec 06 17:08:23 UTC 2018",  
        "iat": "Thu Dec 06 16:08:23 UTC 2018",  
        "email": "[email protected]"  
      }
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content:
      {
        "message": "The incoming token has expired"
      }

    OR

    • Code: 401 UNAUTHORIZED
      Content:
      {
        "message": "Unauthorized"
      }
      Occurs if there is no token attached

Register New User

  • URL

/cognito/users

  • Method: POST

  • Headers:
    Authentication: The access token provided by cognito.

  • Success Response:

    • Code: 200
      Content:
      {
        "User": {
            "Username": "01e05880-930d-4150-a9e0-6c515b546416",
            "Attributes": [
                {
                    "Name": "sub",
                    "Value": "01e05880-930d-4150-a9e0-6c515b546416"
                },
                {
                    "Name": "email",
                    "Value": "[email protected]"
                }
            ],
            "UserCreateDate": "2018-12-05T21:16:41.771Z",
            "UserLastModifiedDate": "2018-12-05T21:16:41.771Z",
            "Enabled": true,
            "UserStatus": "FORCE_CHANGE_PASSWORD"
        }
      }
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content:
      {
        "message": "The incoming token has expired"
      }

    OR

    • Code: 401 UNAUTHORIZED
      Content:
      {
        "message": "Unauthorized"
      }
      Occurs if there is no token attached

cognitoservice's People

Contributors

btkruppa avatar

Watchers

James Cloos avatar  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.