Follow up assignment of ShinyProxy lecture
7월 17일 Virtual Box를 이용해 ShinyProxy 환경을 구축하는 강의가 있었습니다. 강의 시간에 직접 해보지 못한 Social Login 중 Google Authentication 방법에 대해 알아보겠습니다.
지난 Lecture에서 구축한 환경설정 간단하게 리뷰
Application.yml을 project folder에 생성하여 Social login을 사용하도록 설정
Google Developer Console에서 OAuth 설정을 통해 Client Id, Key 발급과 Redirection URL 설정
ShinyManager (https://datastorm-open.github.io/shinymanager/)
ShinyProxy (https://www.shinyproxy.io/)
Google OAuth 설정으로 넘어가기 전에…
| grep shinyproxy sudo docker images
Rstudio server 로그인 후 Terminal에서 shinyproxy 실행
-jar shinyproxy-2.5.0.jar java
127.0.0.1:8080으로 접속하여 admin 계정을 통해 login 기능 작동 확인
application.yml : Authentication 방법을 정의하는 파일로 simple, LDAP, openid, social 등의 방법 선택 가능 (authentication: {원하는 로그인 방식})
RStudio server에서 홈 디렉토리에 application.yml 파일 생성(아래 코드를 복사하세요)
:
proxy: Shiny App
title-url: https://www.openanalytics.eu/shinyproxy/logo.png
logo-page: /
landing-rate: 10000
heartbeat-timeout: 60000
heartbeat: 8080
port: social
authentication-groups: scientists
admin:
openid-url: https://accounts.google.com/o/oauth2/v2/auth
auth-url: https://www.googleapis.com/oauth2/v4/token
token-url: https://www.googleapis.com/oauth2/v3/certs
jwks-id: 528600301937-aic4b7n55ka3ac9he6g4d67fb6cdrkc6.apps.googleusercontent.com
client-secret: x7KIiNvJcwh4cl2eouPJ3IiS
client# Docker configuration
:
social:
google-id: 528600301937-aic4b7n55ka3ac9he6g4d67fb6cdrkc6.apps.googleusercontent.com
app-secret: x7KIiNvJcwh4cl2eouPJ3IiS
app:
docker: http://localhost:2375
url-range-start: 20000
port:
specs- id: 01_hello
-name: Hello Application
display: Application which demonstrates the basics of a Shiny app
description-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-groups: [scientists, mathematicians]
access- id: 06_tabsets
-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-groups: scientists
access
:
logging:
file shinyproxy.log
ShinyProxy는 Spring framework 기반으로 작성되어 application.yml 수정을 통해 여러 인증방법을 적용할 수 있습니다.
Facebook, Github 등 여러 API provider들이 구글과 비슷한 인증 서비스를 제공하고 있어 손쉽게 여러 social 인증을 추가할 수 있습니다.
발급받은 client id와 secret은 외부로 노출되어서는 안됩니다(Github Repo에 commit 금지!)
social과 openid 모두 적용할 수 있으나 redirect url에 차이가 있음에 주의 (정확한 차이는 연구 필요)
If you see mistakes or want to suggest changes, please create an issue on the source repository.
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/zarathucorp/blog, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Ko (2021, July 25). Zarathu Blog: googleAuth. Retrieved from https://blog.zarathu.com/posts/2021-07-25-googleauth/
BibTeX citation
@misc{ko2021googleauth, author = {Ko, HyunJun}, title = {Zarathu Blog: googleAuth}, url = {https://blog.zarathu.com/posts/2021-07-25-googleauth/}, year = {2021} }