BioDT / biodt-shiny

This repository contains a shiny application which is intended as the simplest way of interacting with BioDT by end-users.
Other
4 stars 2 forks source link

r4lexis::get_lexis_user_info() error #7

Closed simonrolph closed 3 months ago

simonrolph commented 7 months ago

When trying to use r4lexis::get_lexis_user_info() I get this error

lexis_oauth_token$access_token : $ operator is invalid for atomic vectors

Traceback:

Error in lexis_oauth_token$access_token :
$ operator is invalid for atomic vectors
8.
is_string(x)
7.
check_string(token, "`token`")
6.
httr2::req_auth_bearer_token(httr2::request(base_path), lexis_oauth_token$access_token) at fct_request.R#26
5.
is_request(req)
4.
check_request(req)
3.
httr2::req_url_path(httr2::req_auth_bearer_token(httr2::request(base_path),
lexis_oauth_token$access_token), request_api_path) at fct_request.R#26
2.
lexis_request_post(lexis_oauth_token, base_path = base_path,
resp_body_type = "json", request_api_path = "auth/realms/LEXIS_AAI/protocol/openid-connect/userinfo") at auth.R#66
1.
r4lexis::get_lexis_user_info("INSERT TOKEN",
base_path = "https://aai.lexis.tech", dry_run = FALSE, verbosity = 0)

(I have removed my token and replaced with "INSERT TOKEN"

Nithador commented 7 months ago

so, for the r4lexis::get_lexis_user_info() the token is actually the whole object You receive from the r4lexis::get_lexis_oauth_token()

This can be done locally in RStudio environment, or in Shiny app run from RStudio, but does not work in Shiny app in container.

Try this in RStudio lexis_token <- r4lexis::get_lexis_oauth_token() user_info <- r4lexis::get_lexis_user_info(lexis_token)