View Javadoc

1   /**
2    *       Copyright 2010 Newcastle University
3    *
4    *          http://research.ncl.ac.uk/smart/
5    *
6    * Licensed to the Apache Software Foundation (ASF) under one or more
7    * contributor license agreements.  See the NOTICE file distributed with
8    * this work for additional information regarding copyright ownership.
9    * The ASF licenses this file to You under the Apache License, Version 2.0
10   * (the "License"); you may not use this file except in compliance with
11   * the License.  You may obtain a copy of the License at
12   *
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   */
21  
22  package org.apache.amber.oauth2.common;
23  
24  import org.apache.amber.oauth2.common.message.types.ParameterStyle;
25  import org.apache.amber.oauth2.common.message.types.TokenType;
26  
27  /**
28   *
29   *
30   *
31   */
32  public final class OAuth {
33  
34      public static final class HttpMethod {
35          public static final String POST = "POST";
36          public static final String GET = "GET";
37          public static final String DELETE = "DELETE";
38          public static final String PUT = "PUT";
39      }
40  
41      public static final class HeaderType {
42          public static final String CONTENT_TYPE = "Content-Type";
43          public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
44          public static final String AUTHORIZATION = "Authorization";
45      }
46  
47      public static final class WWWAuthHeader {
48          public static final String REALM = "realm";
49      }
50  
51      public static final class ContentType {
52          public static final String URL_ENCODED = "application/x-www-form-urlencoded";
53          public static final String JSON = "application/json";
54      }
55  
56      public static final String OAUTH_RESPONSE_TYPE = "response_type";
57      public static final String OAUTH_CLIENT_ID = "client_id";
58      public static final String OAUTH_CLIENT_SECRET = "client_secret";
59      public static final String OAUTH_REDIRECT_URI = "redirect_uri";
60      public static final String OAUTH_USERNAME = "username";
61      public static final String OAUTH_PASSWORD = "password";
62      public static final String OAUTH_ASSERTION_TYPE = "assertion_type";
63      public static final String OAUTH_ASSERTION = "assertion";
64      public static final String OAUTH_SCOPE = "scope";
65      public static final String OAUTH_STATE = "state";
66      public static final String OAUTH_GRANT_TYPE = "grant_type";
67  
68      public static final String OAUTH_HEADER_NAME = "Bearer";
69  
70      //Authorization response params
71      public static final String OAUTH_CODE = "code";
72      public static final String OAUTH_ACCESS_TOKEN = "access_token";
73      public static final String OAUTH_EXPIRES_IN = "expires_in";
74      public static final String OAUTH_REFRESH_TOKEN = "refresh_token";
75      
76      public static final String OAUTH_TOKEN_TYPE = "token_type";
77  
78      public static final String OAUTH_TOKEN = "oauth_token";
79  
80      public static final String OAUTH_TOKEN_DRAFT_0 = "access_token";
81      public static final String OAUTH_BEARER_TOKEN = "access_token";
82  
83      public static final ParameterStyle DEFAULT_PARAMETER_STYLE = ParameterStyle.HEADER;
84      public static final TokenType DEFAULT_TOKEN_TYPE = TokenType.BEARER;
85      
86      public static final String OAUTH_VERSION_DIFFER = "oauth_signature_method";
87  }