1[ 2 { 3 "namespace": "manifest", 4 "types": [ 5 { 6 "$extend": "PermissionNoPrompt", 7 "choices": [{ 8 "type": "string", 9 "enum": [ 10 "identity" 11 ] 12 }] 13 } 14 ] 15 }, 16 { 17 "namespace": "identity", 18 "description": "Use the chrome.identity API to get OAuth2 access tokens. ", 19 "permissions": ["identity"], 20 "types": [ 21 { 22 "id": "AccountInfo", 23 "type": "object", 24 "description": "An object encapsulating an OAuth account id.", 25 "properties": { 26 "id": { 27 "type": "string", 28 "description": "A unique identifier for the account. This ID will not change for the lifetime of the account. " 29 } 30 } 31 } 32 ], 33 "functions": [ 34 { 35 "name": "getAccounts", 36 "type": "function", 37 "unsupported": true, 38 "description": "Retrieves a list of AccountInfo objects describing the accounts present on the profile.", 39 "async": "callback", 40 "parameters": [ 41 { 42 "name": "callback", 43 "type": "function", 44 "parameters": [ 45 { 46 "name": "results", 47 "type": "array", 48 "items": { 49 "$ref": "AccountInfo" 50 } 51 } 52 ] 53 } 54 ] 55 }, 56 { 57 "name": "getAuthToken", 58 "type": "function", 59 "unsupported": true, 60 "description": "Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.", 61 "async": "callback", 62 "parameters": [ 63 { 64 "name": "details", 65 "optional": true, 66 "type": "object", 67 "properties": { 68 "interactive": { 69 "optional": true, 70 "type": "boolean" 71 }, 72 "account": { 73 "optional": true, 74 "$ref": "AccountInfo" 75 }, 76 "scopes": { 77 "optional": true, 78 "type": "array", 79 "items": { 80 "type": "string" 81 } 82 } 83 } 84 }, 85 { 86 "name": "callback", 87 "optional": true, 88 "type": "function", 89 "parameters": [ 90 { 91 "name": "results", 92 "type": "array", 93 "items": { 94 "$ref": "AccountInfo" 95 } 96 } 97 ] 98 } 99 ] 100 }, 101 { 102 "name": "getProfileUserInfo", 103 "type": "function", 104 "unsupported": true, 105 "description": "Retrieves email address and obfuscated gaia id of the user signed into a profile.", 106 "async": "callback", 107 "parameters": [ 108 { 109 "name": "callback", 110 "type": "function", 111 "parameters": [ 112 { 113 "name": "userinfo", 114 "type": "object", 115 "properties": { 116 "email": {"type": "string"}, 117 "id": { "type": "string" } 118 } 119 } 120 ] 121 } 122 ] 123 }, 124 { 125 "name": "removeCachedAuthToken", 126 "type": "function", 127 "unsupported": true, 128 "description": "Removes an OAuth2 access token from the Identity API's token cache.", 129 "async": "callback", 130 "parameters": [ 131 { 132 "name": "details", 133 "type": "object", 134 "properties": { 135 "token": {"type": "string"} 136 } 137 }, 138 { 139 "name": "callback", 140 "optional": true, 141 "type": "function", 142 "parameters": [ 143 { 144 "name": "userinfo", 145 "type": "object", 146 "properties": { 147 "email": {"type": "string"}, 148 "id": { "type": "string" } 149 } 150 } 151 ] 152 } 153 ] 154 }, 155 { 156 "name": "launchWebAuthFlow", 157 "type": "function", 158 "description": "Starts an auth flow at the specified URL.", 159 "async": "callback", 160 "parameters": [ 161 { 162 "name": "details", 163 "type": "object", 164 "properties": { 165 "url": {"$ref": "manifest.HttpURL"}, 166 "interactive": {"type": "boolean", "optional": true} 167 } 168 }, 169 { 170 "name": "callback", 171 "type": "function", 172 "parameters": [ 173 { 174 "name": " responseUrl", 175 "type": "string", 176 "optional": true 177 } 178 ] 179 } 180 ] 181 }, 182 { 183 "name": "getRedirectURL", 184 "type": "function", 185 "description": "Generates a redirect URL to be used in |launchWebAuthFlow|.", 186 "parameters": [ 187 { 188 "name": "path", 189 "type": "string", 190 "default": "", 191 "optional": true, 192 "description": "The path appended to the end of the generated URL. " 193 } 194 ], 195 "returns": { 196 "type": "string" 197 } 198 } 199 ], 200 "events": [ 201 { 202 "name": "onSignInChanged", 203 "unsupported": true, 204 "type": "function", 205 "description": "Fired when signin state changes for an account on the user's profile.", 206 "parameters": [ 207 { 208 "name": "account", 209 "$ref": "AccountInfo" 210 }, 211 { 212 "name": "signedIn", 213 "type": "boolean" 214 } 215 ] 216 } 217 ] 218 } 219] 220