OAuth2Constants.java 2.1 KB

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