Momo Oauth 接入遵循标准的Oauth2.0协议。
名词解释:
https://oauth.immomo.com/oauth/authorize
GET
https://oauth.immomo.com/oauth/authorize?response_type=code&client_id=mmclientdemo&redirect_uri=&scope=name,avatar&state=random_str
查询是否已授权,如果已授权,直接返回已授权的token。
用户授权(授权页面) 用户决议:是否
http://clienturl.com?code=XXXXXXXXXXXXXX&state=random_str
https://oauth.immomo.com/oauth/access_token
POST
https://oauth.immomo.com/oauth/access_token?grant_type=authorization_code&code=codedemo=redirect_uri=&client_id=client_id_demo&client_secret=client_secret_demo 以上为示例,所有参数需要用Post方式传递
{“access_token”:”access_token”,”token_type”:”bearea”,”expires_in”:2592000,”refresh_token”:””,”scope”:”name,avatar”}
https://oauth.immomo.com/resource/profile
POST
https://oauth.immomo.com/resource/profile=?client_id=client_id_demo&access_token=access_token_demo&client_secret=client_secret_demo 以上为示例,所有参数需要用Post方式传递 {“name”:”name”,”avatar”:”http://www.immomo.com/avatar.jpg”}
序号 | 名称 | 备注 |
1 | name | 用户名 |
2 | avatar | 用户头像 |
3 | age | 年纪 |
4 | gender | 性别 |
5 | slogan | 个人留言 |
6 | marital | 情感状态 |
7 | career | 职业 |
8 | school | 学校 |
9 | hometown | 家乡 |
10 | book | 书籍 |
11 | movie | 电影 |
12 | music | 音乐 |
13 | games | 游戏 |