Giter VIP home page Giter VIP logo

grassrootssurveyherokuauth0loginapi's Introduction

Login API for Grassroots Mobile Survey App

Visit our wiki for the project details and further setup instructions.

Deploy

For further information on the projects Salesforce package see repo: @SFDO-Community-Sprints/GrassrootsSurveySalesforcePackage

For further information on the projects mobile app see repo: @SFDO-Community-Sprints/GrassrootsMobileSurveyApp

Setup

  1. Deploy this app to Heroku using above button.
  2. Open Auth0 app and enable [Password] authentication type at advanced settings section. Then add your users.
  3. Create an integration user in your Salesforce org.
  4. Open the Heroku app setting and set config variables for the integration user.

API Spec for Developers

POST /login

Request

  • Content-Type: application/json
  • Body:
{
    "email": "[email protected]",
    "password": "test1234!"
}

Reponsse

Success (200)
{
    "access_token": "00D28000000W2x5!AQQAQNTgJ_KyS9.BuohNq9_Awami_.OL9MiZe24bTt75Un56KChhd7lfJ2J.R_XdgP2cvx_clufew6i9acH8FKG9wacaDdgj",
    "instance_url": "https://YOUR_INSTANCE_OR_DOMAIN.salesforce.com"
}
Error (400, Environment variable is not set correctly)
{
    "error": "invalid_environment_variable",
    "error_description": "SALESFORCE_LOGIN_URL must end with '.salesforce.com'. Contact your administrator to see Heroku setting."
}
Error (403, Password realm is not setup yet)

Make sure that password type grant is enabled in your default auth0 app setting.

{
    "error": "unauthorized_client",
    "error_description": "Grant type 'http://auth0.com/oauth/grant-type/password-realm' not allowed for the client.",
    "error_uri": "https://auth0.com/docs/clients/client-grant-types"
}
Error (403, Invalid user email or password)

Make sure that your request is correct.

{
    "error": "invalid_grant",
    "error_description": "Wrong email or password."
}
Error (403, Invalid config variables)

Make sure that your config variables in Heroku setting are correct.

{
    "error": "invalid_salesforce_connection",
    "error_description": "INVALID_LOGIN: Invalid username, password, security token; or user locked out."
}

grassrootssurveyherokuauth0loginapi's People

Contributors

coriobriensfdo avatar shunkosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grassrootssurveyherokuauth0loginapi's Issues

Error Handling

API should return correct response when heroku setting is wrong

  • For wrong SALESFORCE_LOGIN_URL
  • For wrong `.env@ file.

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.