BigW Consortium Gitlab

session.md 1.1 KB
Newer Older
1 2
# Session

3 4
You can login with both GitLab and LDAP credentials in order to obtain the
private token.
5 6 7 8 9

```
POST /session
```

10 11 12 13 14
| Attribute  | Type    | Required | Description |
| ---------- | ------- | -------- | -------- |
| `login`    | string  | yes      | The username of the user|
| `email`    | string  | yes if login is not provided | The email of the user |
| `password` | string  | yes     | The password of the user |
15

16 17 18
```bash
curl -X POST "https://gitlab.example.com/api/v3/session?login=john_smith&password=strongpassw0rd"
```
19

20
Example response:
Dmitriy Zaporozhets committed
21

22 23 24
```json
{
  "name": "John Smith",
25 26 27 28 29 30
  "username": "john_smith",
  "id": 32,
  "state": "active",
  "avatar_url": null,
  "created_at": "2015-01-29T21:07:19.440Z",
  "is_admin": true,
Alex Denisov committed
31 32 33 34
  "bio": null,
  "skype": "",
  "linkedin": "",
  "twitter": "",
Jerome Dalbert committed
35
  "website_url": "",
36
  "email": "john@example.com",
37
  "theme_id": 1,
38 39 40 41
  "color_scheme_id": 1,
  "projects_limit": 10,
  "current_sign_in_at": "2015-07-07T07:10:58.392Z",
  "identities": [],
42
  "can_create_group": true,
43 44 45
  "can_create_project": true,
  "two_factor_enabled": false,
  "private_token": "9koXpg98eAheJpvBs5tK"
46 47
}
```