oauth.coinmode.com Open in urlscan Pro
104.26.13.61  Public Scan

Submitted URL: https://oauth.coinmode.com/
Effective URL: https://oauth.coinmode.com/docs/
Submission: On October 16 via automatic, source certstream-suspicious — Scanned from DE

Form analysis 3 forms found in the DOM

<form class="form-horizontal">
  <fieldset>
    <div class="form-group">
      <label class="col-md-3 control-label" for="-sample-request-url"></label>
      <div class="input-group">
        <input id="-sample-request-url" type="text" class="form-control sample-request-url" value="https://oauth.coinmode.com/v1/auth/discord/user">
        <span class="input-group-addon">url</span>
      </div>
    </div>
    <h3>Parameters</h3>
    <h4><input type="checkbox" data-sample-request-param-group-id="sample-request-param-0" name="Authentication-_v1_auth_discord_user-0_0_0-sample-request-param" value="0" class="sample-request-param sample-request-switch" checked="">Parameter
      <select name="Authentication-_v1_auth_discord_user-0_0_0-sample-header-content-type" class="Authentication-_v1_auth_discord_user-0_0_0-sample-request-param-select sample-header-content-type sample-header-content-type-switch">
        <option value="undefined" selected="">ajax-auto</option>
        <option value="body-json">body/json</option>
        <option value="body-form-data">body/form-data</option>
      </select>
    </h4>
    <div class="Authentication-_v1_auth_discord_user-0_0_0-sample-request-param-body Authentication-_v1_auth_discord_user-0_0_0-sample-header-content-type-body hide">
      <div class="form-group">
        <div class="input-group">
          <textarea id="sample-request-body-json" class="form-control sample-request-body" data-sample-request-body-group="sample-request-param-0" rows="6" style="OVERFLOW: visible"></textarea>
          <div class="input-group-addon">json</div>
        </div>
      </div>
    </div>
    <div class="Authentication-_v1_auth_discord_user-0_0_0-sample-request-param-fields Authentication-_v1_auth_discord_user-0_0_0-sample-header-content-type-fields">
      <div class="form-group">
        <label class="col-md-3 control-label" for="sample-request-param-field-externalSignInId">externalSignInId</label>
        <div class="input-group">
          <input id="sample-request-param-field-externalSignInId" type="text" placeholder="externalSignInId" class="form-control sample-request-param" data-sample-request-param-name="externalSignInId"
            data-sample-request-param-group="sample-request-param-0">
          <div class="input-group-addon">string</div>
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <button class="btn btn-warning sample-request-send" data-sample-request-type="get">Send</button>
      </div>
    </div>
    <div class="form-group sample-request-response" style="display: none;">
      <h3> Response <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
      </h3>
      <pre class="prettyprint language-json prettyprinted" data-type="json" style=""><code class="sample-request-response-json"></code></pre>
    </div>
  </fieldset>
</form>

<form class="form-horizontal">
  <fieldset>
    <div class="form-group">
      <label class="col-md-3 control-label" for="-sample-request-url"></label>
      <div class="input-group">
        <input id="-sample-request-url" type="text" class="form-control sample-request-url" value="https://oauth.coinmode.com/v1/auth/discord/url">
        <span class="input-group-addon">url</span>
      </div>
    </div>
    <h3>Parameters</h3>
    <h4><input type="checkbox" data-sample-request-param-group-id="sample-request-param-0" name="Authentication-_v1_auth_discord_url-0_0_0-sample-request-param" value="0" class="sample-request-param sample-request-switch" checked="">Parameter <select
        name="Authentication-_v1_auth_discord_url-0_0_0-sample-header-content-type" class="Authentication-_v1_auth_discord_url-0_0_0-sample-request-param-select sample-header-content-type sample-header-content-type-switch">
        <option value="undefined" selected="">ajax-auto</option>
        <option value="body-json">body/json</option>
        <option value="body-form-data">body/form-data</option>
      </select>
    </h4>
    <div class="Authentication-_v1_auth_discord_url-0_0_0-sample-request-param-body Authentication-_v1_auth_discord_url-0_0_0-sample-header-content-type-body hide">
      <div class="form-group">
        <div class="input-group">
          <textarea id="sample-request-body-json" class="form-control sample-request-body" data-sample-request-body-group="sample-request-param-0" rows="6" style="OVERFLOW: visible"></textarea>
          <div class="input-group-addon">json</div>
        </div>
      </div>
    </div>
    <div class="Authentication-_v1_auth_discord_url-0_0_0-sample-request-param-fields Authentication-_v1_auth_discord_url-0_0_0-sample-header-content-type-fields">
      <div class="form-group">
        <label class="col-md-3 control-label" for="sample-request-param-field-redirectURI">redirectURI</label>
        <div class="input-group">
          <input id="sample-request-param-field-redirectURI" type="text" placeholder="redirectURI" class="form-control sample-request-param" data-sample-request-param-name="redirectURI" data-sample-request-param-group="sample-request-param-0">
          <div class="input-group-addon">string</div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-3 control-label" for="sample-request-param-field-createUser">createUser</label>
        <div class="input-group">
          <input id="sample-request-param-field-createUser" type="text" placeholder="createUser" class="form-control sample-request-param" data-sample-request-param-name="createUser" data-sample-request-param-group="sample-request-param-0">
          <div class="input-group-addon">string</div>
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <button class="btn btn-warning sample-request-send" data-sample-request-type="get">Send</button>
      </div>
    </div>
    <div class="form-group sample-request-response" style="display: none;">
      <h3> Response <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
      </h3>
      <pre class="prettyprint language-json prettyprinted" data-type="json" style=""><code class="sample-request-response-json"></code></pre>
    </div>
  </fieldset>
</form>

<form class="form-horizontal">
  <fieldset>
    <div class="form-group">
      <label class="col-md-3 control-label" for="-sample-request-url"></label>
      <div class="input-group">
        <input id="-sample-request-url" type="text" class="form-control sample-request-url" value="https://oauth.coinmode.com/v1/auth/discord/server">
        <span class="input-group-addon">url</span>
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <button class="btn btn-warning sample-request-send" data-sample-request-type="get">Send</button>
      </div>
    </div>
    <div class="form-group sample-request-response" style="display: none;">
      <h3> Response <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
      </h3>
      <pre class="prettyprint language-json prettyprinted" data-type="json" style=""><code class="sample-request-response-json"></code></pre>
    </div>
  </fieldset>
</form>

Text Content

x
   
 * Overview
 * Authentication
 * Discord Authorized User Information
   /v1/auth/discord/user
 * Discord Sign in URL
   /v1/auth/discord/url
 * Discord Sign in
   /v1/auth/discord/server


COINMODE AUTH


A COINMODE SERVICE FACILITATING 'SIGN IN WITH DISCORD' INTO COINMODE PRODUCTS
LIKE APPS/PLUGINS ETC. NOT JUST LIMITED TO DISCORD.

1.0.0 
 * Compare all with predecessor
 * 
 * show up to version:
 * 1.0.0
 * 0.0.0




HOW TO USE IT?

For the sake of understanding and clarity, discord is used an example. General
concepts and ideas would still be valid for other services we may add in the
future.


USING IT ON THE 'WEB'

This is only useful for services that are built on 'web' i.e. website, iframe
etc.

How to log in via Discord?
 1.  Call /v1/auth/discord/url with redirectURI as "https://coinmode.com/login"
 2.  Navigate the user to url returned from /v1/auth/discord/url
 3.  This will take the user to discord 'log in' page
 4.  Once user authorizes discord, discord redirects to
     "https://coinmode.com/login"
 5.  There will be externalSignInId injected i.e.
     "https://coinmode.com/login?externalSignInId=wT1b0V8bv5IquVnilKO7K%2FXg5yfL5nvhYLKFdkJ2Qp4%3D"
 6.  Extract externalSignInId from the URL
 7.  Call /v1/auth/discord/user with externalSignInId extracted from the URL
 8.  Discord id and more is returned from the response
 9.  Call /v1/players/login_request with discord_id (other params remain same)
 10. Call /v1/players/login_verify with discord_sign_in_id as externalSignInId
 11. No need to pass password to /v1/players/login_verify (other params remain
     same)
 12. Of course pass in twofactor if the user has 2fa enabled
 13. Thats it!

How to register via Discord?
 1. Call /v1/auth/discord/url with redirectURI as "https://coinmode.com/login"
    and createUser as true
 2. All the same steps for How to log in via Discord?


USING IT VIA API

This is useful for any services such as mobile, plugins and including 'web'
services.

How to log in via Discord?
 1.  Call /v1/auth/discord/url
 2.  Open the browser and navigate the user to url returned from
     /v1/auth/discord/url
 3.  This will take the user to discord 'log in' page
 4.  Call /v1/auth/discord/user with externalSignInId return from
     /v1/auth/discord/url
 5.  Discord id and more is returned from the response
 6.  Call /v1/players/login_request with discord_id (other params remain same)
 7.  Call /v1/players/login_verify with discord_sign_in_id as externalSignInId
 8.  No need to pass password to /v1/players/login_verify (other params remain
     same)
 9.  Of course pass in twofactor if the user has 2fa enabled
 10. Thats it!

How to register via Discord?
 1. Call /v1/auth/discord/url with createUser as true
 2. All the same steps for How to log in via Discord?


AUTHENTICATION


V1 AUTH DISCORD USER - DISCORD AUTHORIZED USER INFORMATION

0.0.0 
 * compare changes to:
 * 0.0.0





With externalSignInId (obtained from /v1/auth/discord/url) this will return
authorized user information such as id, email and few more information.
PLEASE NOTE: None of this information is stored on server. Information is
remembered for very small period of time.



get

/v1/auth/discord/user

Permission: none


PARAMETER

Field Type Description externalSignInId string

Unique ID for obtaining user information from discord.


SUCCESS 200

Field Type Description status string

ok

View success Example Responses
 * Success

{
    "createUser": false,
    "id": "8969821974966239498",
    "email": "juan16@gottakh.com",
    "other": {
        "id": "891982197496639498",
        "username": "juan16",
        "avatar": null,
        "discriminator": "6074",
        "public_flags": 0,
        "flags": 0,
        "banner": null,
        "banner_color": null,
        "accent_color": null,
        "locale": "en-GB",
        "mfa_enabled": false,
        "email": "juan16@gottakh.com",
        "verified": true
    },
    "status": "ok",
    "duration": 0
}

View error Example Responses
 * EXAMPLE_ERR

{
    error: 'EXAMPLE_ERR',
    details: { hello: "world" },
    userMessage: `Hello there! Erm . . . something went wrong!!!`,
}

Open Send Options


SEND A SAMPLE REQUEST

url


PARAMETERS

PARAMETER AJAX-AUTO BODY/JSON BODY/FORM-DATA

json
externalSignInId
string
Send


RESPONSE X




V1 AUTH DISCORD URL - DISCORD SIGN IN URL

0.0.0 
 * compare changes to:
 * 0.0.0





Returns a special login URL and a token to pinging purposes.



get

/v1/auth/discord/url

Permission: none


PARAMETER

Field Type Description redirectURI string

Optionally you may pass redirect URI to redirect to after completion of
authorization from discord.

createUser string

Optionally it will create a user with discord email if there is no user in
coinmode by the same email.


SUCCESS 200

Field Type Description status string

ok

View success Example Responses
 * Success

{
    "url": "https://discord.com/api/oauth2/authorize?client_id=887581230802026507&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fv1%2Fauth%2Fdiscord&response_type=code&scope=identify+email&state=qIT3mHaPtGnjE%2B%2B78FhR4%2BIuU3KB6X80Pnmvi9KcdH8%3D",
    "externalSignInId": "qIT3mHaPtGnjE%2B%2B78FhR4%2BIuU3KB6X80Pnmvi9KcdH8%3D",
    "status": "ok",
    "duration": 0
}

View error Example Responses
 * EXAMPLE_ERR

{
    error: 'EXAMPLE_ERR',
    details: { hello: "world" },
    userMessage: `Hello there! Erm . . . something went wrong!!!`,
}

Open Send Options


SEND A SAMPLE REQUEST

url


PARAMETERS

PARAMETER AJAX-AUTO BODY/JSON BODY/FORM-DATA

json
redirectURI
string
createUser
string
Send


RESPONSE X




V1 AUTH DISCORD SERVER - DISCORD SIGN IN

0.0.0 
 * compare changes to:
 * 0.0.0





This is called by the Discord Server when the authorization is completed.



get

/v1/auth/discord/server

Permission: none


SUCCESS 200

Field Type Description status string

ok

View success Example Responses
 * Success

{
    "readme": "Nothing here!",
    "status": "ok",
    "duration": 0
}

View error Example Responses
 * EXAMPLE_ERR

{
    error: 'EXAMPLE_ERR',
    details: { hello: "world" },
    userMessage: `Hello there! Erm . . . something went wrong!!!`,
}

Open Send Options


SEND A SAMPLE REQUEST

url
Send


RESPONSE X




Generated with apidoc 0.17.7 - 2021-10-16T18:57:28.341Z