I can not generate token in the server side of shiny app
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- azure, r
- Domain
- authentication
Research direction
Start with the AzureAuth::get_azure_token call in the issue and compare its server-side arguments with the linked AzureAuth Shiny example, especially the resource scopes, auth_code, and password values. Reproduce the call with and without offline_access and trace the resulting token object and error. Done means the server-side authorization-code flow generates a usable token without either reported error.
Written by the indexing model from the issue text.
Description
hi
I am developing the corporate shiny app via golem package and it is required to implement oath2.0 authentication and authorization workflow. For this purpose i am using the example specified here.
The ui section works well (i am using the templeate as in example without any changes) -> i am logging in through microsoft login service -> redirect to the site specified in redirect_uri -> the app works as expected.
The server generates an error. The error is generated by get_azure_token(). I have used the same approach as in server section of the snippet -> applied the example as it is -> password = client_secret.
token <- AzureAuth::get_azure_token(
resource = c('my_resource/.default', 'openid')
,tenant = 'my_tenant_id'
,app = "my_app_id"
,password = client_secret
,auth_type = "authorization_code"
,auth_code = opts$code
,authorize_args = list(redirect_uri = redirect)
,version = 2
,use_cache = FALSE
)
The error is as follows:
[1] "start token generation ..."
Server did not provide a refresh token: you will have to reauthenticate to refresh.
Add the 'offline_access' scope to obtain a refresh token.
if i add 'offline_access' to the scope -> c('my_resource/.default', 'openid', 'offline_access') -> the error is changed to:
[1]"start token generation ..."
Warning: Error in as.vector: cannot coerce type 'environment' to vector of type 'character'
47: as.character.default
45: sprintf
40: server
3: runApp
2: print.shiny.appobj
1: <Anonymous>
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
I would be gratefull for any hint to resolve the issue.
- Dominant language
- R
- Stars
- 48
- Forks
- 23
- Avg merge
- 4h 2m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/AzureAuth
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
documentation pkg infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiverse-trace/epiparameter#511 ·
-
function:write_dwc
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100