Forbidden Error 403 Google Apps
Contents |
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
am I seeing a 403 Forbidden error message? Browse by products and services DV and VPS Hosting Grid Shared Hosting Legacy DV Hosting Applies to: Grid Difficulty: Medium Time Needed: 20 Tools Required: FTP client, plain text editor Applies to: All DV Difficulty: Easy Time Needed: https://mediatemple.net/community/products/dv/204644980/why-am-i-seeing-a-403-forbidden-error-message 10 Tools Required: FTP client, plain text editor Overview The 403 Forbidden error is an http://stackoverflow.com/questions/20372453/getting-a-403-forbidden-for-google-service-account HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason. This article contains basic troubleshooting instructions for 403 Forbidden errors. Symptom You get the following error when you try to visit a web page: Figure 1. Causes and Solutions There are three common causes for this error. Here error 403 they are listed from most likely to least likely. Empty html directory Empty httpdocs directory Make sure that your website content has been uploaded to the correct directory on your server. Remember to replace example.com with your own domain name. Grid: /domains/example.com/html/ This is the path you will use for FTP. However, the full path to your website content is /home/00000/domains/example.com/html/. The 00000 is your site number. See this article for details. DV server: /var/www/vhosts/dv-example.com/httpdocs/ When error 403 google you connect with your FTP user, you just need to navigate into the httpdocs directory. If this folder does not exist, feel free to create it. No index page The home page for your website must be called index.php or index.html. To resolve this error, upload an index page to your htmlhttpdocs directory. If you already have a home page called something else - home.html for example - you have a couple of options: Rename your home page to index.html or index.php. Set up a redirect on the index page to your real home page. See How do I redirect my site using a .htaccess file? for details. Set a different default home page in your .htaccess.htaccess file. Javascript Kit has a good example. If you don't want a single page to display, but instead want to show a list of files in that directory, see Making directories browsable, solving 403 errorsMaking directories browsable, solving 403 errors. Permissions and ownership errors A 403 Forbidden error can also be caused by incorrect ownership or permissions on your web content files and folders. Permissions Rule of thumb for correct permissions: Folders: 755 Static Content: 644 Dynamic Content: 700 Please see File Permissions for a complete discussion of permissions and security. TIP: Linux permissions can be represented with numbers, letters, or words. They also include an entry for Ow
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting a 403 - Forbidden for Google Service Account up vote 0 down vote favorite I am trying to get an access token for Google Service Account. Following is my code - String SERVICE_ACCOUNT_EMAIL = "edited@developer.gserviceaccount.com"; List scope = new ArrayList(); scope.add("https://www.googleapis.com/auth/admin.directory.user"); String keyFile = "C:\\edited-privatekey.p12"; HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); JsonFactory JSON_FACTORY = new JacksonFactory(); GoogleCredential credential = new GoogleCredential.Builder() .setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(SERVICE_ACCOUNT_EMAIL) .setServiceAccountScopes(scope) .setServiceAccountPrivateKeyFromP12File(new java.io.File(keyFile)) .build(); credential.refreshToken(); String accessTokens = credential.getAccessToken(); Although the code works fine and I do get an access token, when I try to use it to 'GET' a Google Apps User using the Google Directory APIs, I get a 403 - Forbidden response code. Could someone please help? I know the code for GET user is correct because it works fine with the access token generated by Google Apps Admin. google-api google-apps google-oauth google-api-java-client google-oauth-java-client share|improve this question asked Dec 4 '13 at 10:12 Sayali 13319 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote You need to set an admin account with: .setServiceAccountUser(some_admin_email) And make sure your App (with the correct scopes) is granted access in the cpanel. share|improve this answer answered Dec 4 '13 at 10:52 qtxo 20624 1 Thanks for your help. I am getting following error after adding setServiceAccount - Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "access_denied", "error_description" : "Requested scopes not allowed: googleapis.com/auth/admin.directory.user" } The API access and services is both ON (else the admin access token would not have worked). The scope accesses are also ON. Is there any other specific setting that I s