Simplified SSO

验证用户

注:以下链接地址仅为示例,实际地址以项目为准。

使用我们平台的API验证用户,做一个简单的HTTPS POST请求:

https://apisandbox.betalk.com/oauth/token (for sandbox environment)

https://api.betalk.com/oauth/token (for production environment)

POST /oauth/token Host: https://apisandbox.BeTalk.com Content-Type: application/x-www-form-urlencoded  client_id=INSERT_CLIENT_ID& client_secret=INSERT_CLIENT_SECRET& grant_type=http://www.BeTalk.com/auth_uniqueid& uniqueid=INSERT_UNIQUE_USER_IDENTIFIER& timestamp=TIMESTAMP& firstname=INSERT_FIRST_NAME& lastname=INSERT_LAST_NAME

如果成功的验证,并验证了请求,BeTalk 将返回一个JSON格式的访问token

{     "access_token": "F6YwMQAAATp7lE9TAACowENMLWNsaWVudCAgICAgICAgICAgICAgAAAAAw",     "token_type": "bearer",     "expires_in": 43199,     "scope": "read write" }

请求参数

名称 描述
client_id String 要求: 注册BeTalk,获得的用户ID
client_secret String 要求: 收到 BeTalk注册密码
grant_type String Required: This should always be set to ‘http://www.BeTalk.com/auth_uniqueid’.
uniqueid String Requried: unqiue string (Example – email address, username, phone numbers, User ID, UID etc…) from your user management or identity system.
timestamp String Required: UTC timestamp in millseconds. Current UTC time in milliseconds:1452493833248
firstname String Optional: User’s first name
lastname String Optional: User’s last name
orgid String Optional: The BeTalk Organization (Org) ID. This parameter is only valid if you are creating separate Org for each of your customer account in BeTalk.
pictureurl String Optional: URL of user’s avatar or profile picture
timezone String Optional: this user’s timezone based on TZ string in the tz database. For example, America/Los_Angeles, Asia/Shanghai.
plancode String Optional: Plan code or package code assigned by BeTalk for the org. May not be applicable for most of the cases.

响应参数

名称 描述
access_token Token generated for the user to use with Betalk API and SDKs.
token_type This always has the value of “bearer”.
expires_in Access token expiration time (in seconds)