Skip to content

mogeta/eve_auth_cloud_functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud functionでEVEOnlineの認証、管理を行うためのコード。

やってること

  • codeがない場合はリダイレクト
  • codeが帰ってきたら
    • stateのチェック
    • accesstokenの有効性チェック
    • ユーザーの新規登録 or 更新
    • firebaseとEVEOnlineのトークンを返却。

command

$ go mod tidy

deploy

$ gcloud functions deploy Callback --runtime go113 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml --region asia-northeast1

.env.yaml example

RedirectURL: 'http://localhost:8080'
ClientID: 'hoge'
ClientSecret: 'fuga'
AdminJsonFile: ''

https://cloud.google.com/functions/docs/deploying?hl=ja

firesotre.rules example

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /access_token/{token} {
      allow read, update, delete: if request.auth != null && request.auth.uid == token;
      allow create: if request.auth != null;
    }
  }
}

EVEOnline 公式ドキュメント周り

reference

https://github.com/douglasmakey/oauth2-example

About

EVEOnlineの認証をcloud functionでやる。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published