iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌟

How to Resolve 403 Errors in Skicka

に公開

Introduction

I wanted to use Skicka to upload data from a GitHub repository to Google Drive.
I ran into a 403 error along the way, so I'm writing down the solution here as a note.

Issue

I tried to issue a Skicka token, but it resulted in a 403 error and I couldn't proceed.

Current Status

I implemented it by referring to the following article, and I was able to proceed without issues until writing skicka.config, but after that, I got stuck due to the problem mentioned above.
There might have been some changes on the GCP side.

https://qiita.com/sekitaka_1214/items/85875d64c226b2f7ab86

After filling out the file and running skicka -no-browser-auth df, an authentication URL is returned.
Accessing the specified URL should lead to the authentication screen, but a 403 error occurs, and I cannot move forward.

Cause

It seems a 403 error occurs if you haven't registered yourself as a test user (Information from Twitter).

Solution

Registering a Test User

  1. Access the "OAuth consent screen" within "APIs & Services".

  2. Click the add button to display the input screen, then enter your email address in the input field and register.

Verification

  1. After registering yourself as a test user, try running skicka -no-browser-auth df again.
#skicka -no-browser-auth df
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=XXX.apps.googleusercontent.com...
  1. Access the URL obtained above.
    Unlike before, although a warning appears, it looks like you can proceed from Continue.

  2. Log in according to the screen instructions.

  3. Obtain the token and enter it.

Enter verification code: { token obtained }
  1. Access successful!!!
    Successfully retrieved Google Drive information!
Updating metadata cache: [=======================================================================] 100.00% 5m32s
Capacity   100.00 GiB
Trash        2.04 GiB     2.04%
Drive       12.26 GiB    12.26%
Gmail      262.72 MiB     0.26%
Photos      77.91 GiB    77.91%
Free space   7.53 GiB     7.53%

(100GB plan, with 7GB free...)

  1. Obtain token information.
# cat /root/.skicka.tokencache.json
{"ClientId":"{client_id}","access_token":"{token}","token_type":"Bearer","refresh_token":"{token}","expiry":"2022-01-22T14:23:59.9556225Z"}#

Now, all that's left is to implement using this token information.

References

Tweet mentioning that a test user is required

https://qiita.com/satackey/items/34c7fc5bf77bd2f5c633

https://qiita.com/sekitaka_1214/items/19b27a837fe87b7b9ff9

https://qiita.com/satackey/items/34c7fc5bf77bd2f5c633

https://qiita.com/sekitaka_1214/items/85875d64c226b2f7ab86

https://ifritjp.github.io/blog2/public/posts/2020/2020-12-05-lns-release/

GitHubで編集を提案

Discussion