| 14792 |
manas |
1 |
/**
|
|
|
2 |
* Copyright 2010-present Facebook.
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
package com.facebook;
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* Indicates where a Facebook access token was obtained from.
|
|
|
21 |
*/
|
|
|
22 |
public enum AccessTokenSource {
|
|
|
23 |
/**
|
|
|
24 |
* Indicates an access token has not been obtained, or is otherwise invalid.
|
|
|
25 |
*/
|
|
|
26 |
NONE(false),
|
|
|
27 |
/**
|
|
|
28 |
* Indicates an access token was obtained by the user logging in through the
|
|
|
29 |
* Facebook app for Android using the web login dialog.
|
|
|
30 |
*/
|
|
|
31 |
FACEBOOK_APPLICATION_WEB(true),
|
|
|
32 |
/**
|
|
|
33 |
* Indicates an access token was obtained by the user logging in through the
|
|
|
34 |
* Facebook app for Android using the native login dialog.
|
|
|
35 |
*/
|
|
|
36 |
FACEBOOK_APPLICATION_NATIVE(true),
|
|
|
37 |
/**
|
|
|
38 |
* Indicates an access token was obtained by asking the Facebook app for the
|
|
|
39 |
* current token based on permissions the user has already granted to the app.
|
|
|
40 |
* No dialog was shown to the user in this case.
|
|
|
41 |
*/
|
|
|
42 |
FACEBOOK_APPLICATION_SERVICE(true),
|
|
|
43 |
/**
|
|
|
44 |
* Indicates an access token was obtained by the user logging in through the
|
|
|
45 |
* Web-based dialog.
|
|
|
46 |
*/
|
|
|
47 |
WEB_VIEW(false),
|
|
|
48 |
/**
|
|
|
49 |
* Indicates an access token is for a test user rather than an actual
|
|
|
50 |
* Facebook user.
|
|
|
51 |
*/
|
|
|
52 |
TEST_USER(true),
|
|
|
53 |
/**
|
|
|
54 |
* Indicates an access token constructed with a Client Token.
|
|
|
55 |
*/
|
|
|
56 |
CLIENT_TOKEN(true);
|
|
|
57 |
|
|
|
58 |
private final boolean canExtendToken;
|
|
|
59 |
|
|
|
60 |
AccessTokenSource(boolean canExtendToken) {
|
|
|
61 |
this.canExtendToken = canExtendToken;
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
boolean canExtendToken() {
|
|
|
65 |
return canExtendToken;
|
|
|
66 |
}
|
|
|
67 |
}
|