e21288314958b6d8154a8f1e62a8ad320dde8254
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / OAuth2Constants.java
1 /* ownCloud Android client application
2 *
3 * @author David A. Velasco
4 * Copyright (C) 2012-2013 ownCloud Inc.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19
20 package com.owncloud.android.authentication;
21
22 /**
23 * Constant values for OAuth 2 protocol.
24 *
25 * Includes required and optional parameter NAMES used in the 'authorization code' grant type.
26 */
27
28 public class OAuth2Constants {
29
30 /// Parameters to send to the Authorization Endpoint
31 public static final String KEY_RESPONSE_TYPE = "response_type";
32 public static final String KEY_REDIRECT_URI = "redirect_uri";
33 public static final String KEY_CLIENT_ID = "client_id";
34 public static final String KEY_SCOPE = "scope";
35 public static final String KEY_STATE = "state";
36
37 /// Additional parameters to send to the Token Endpoint
38 public static final String KEY_GRANT_TYPE = "grant_type";
39 public static final String KEY_CODE = "code";
40
41 /// Parameters received in an OK response from the Token Endpoint
42 public static final String KEY_ACCESS_TOKEN = "access_token";
43 public static final String KEY_TOKEN_TYPE = "token_type";
44 public static final String KEY_EXPIRES_IN = "expires_in";
45 public static final String KEY_REFRESH_TOKEN = "refresh_token";
46
47 /// Parameters in an ERROR response
48 public static final String KEY_ERROR = "error";
49 public static final String KEY_ERROR_DESCRIPTION = "error_description";
50 public static final String KEY_ERROR_URI = "error_uri";
51 public static final String VALUE_ERROR_ACCESS_DENIED = "access_denied";
52
53 }