BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ullsokk
Pyrite | Level 9

I am trying to register an application using the following python code: 

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + IDtoken ,
}

data = { "client_id": "myclientid",
        "client_secret": "myclientsecret",
        "scope": ["openid", "group1"],
        "authorized_grant_types": ["authorization_code","refresh_token"],
        "redirect_uri": "urn:ietf:wg:oauth:2.0:oob" }

I have one custom group in Viya that I want to include in scope, in addition to "openid". Am I supposed to use the group name or the group ID in the request? The group name is something like MF_modelfactory_RW, and group id is, by happenstance, "group1" (just as the example code).   

1 ACCEPTED SOLUTION

Accepted Solutions
joeFurbee
Community Manager

Hi @Ullsokk,

The value for 'scope' in your code should be the group ID. This would be as it appears in SAS Environment Manager.

I took a look in my EM instance and see Name: Esri Users and ID: EsriUsers. In this instance I'd use EsriUsers in the scope.

 

Here's a link to a SASGF paper on OAuth and Viya. I consider it my go to for questions. Perhaps you will find it of use, if you'd not already discovered it.

 

Thanks,

Joe


Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl

View solution in original post

4 REPLIES 4
joeFurbee
Community Manager

Hi @Ullsokk,

The value for 'scope' in your code should be the group ID. This would be as it appears in SAS Environment Manager.

I took a look in my EM instance and see Name: Esri Users and ID: EsriUsers. In this instance I'd use EsriUsers in the scope.

 

Here's a link to a SASGF paper on OAuth and Viya. I consider it my go to for questions. Perhaps you will find it of use, if you'd not already discovered it.

 

Thanks,

Joe


Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl

Ullsokk
Pyrite | Level 9

Thank you!

Is this (the fact that group ID as opposed to name is expected) explicitly stated somewhere official? Just wondering I am missing some major part of the documentation, as I can't find this in writing anywhere

alancox
Obsidian | Level 7

Hi @Ullsokk 

 

there's some good examples (& similar questions) in this SAS blog post by @joeFurbee  :

 

https://blogs.sas.com/content/sgf/2019/01/25/authentication-to-sas-viya/

 

Alan

joeFurbee
Community Manager

Hi @Ullsokk,

In addition to the post @alancox mentions, you can refer to @MikeRoda 's SASGF paper: OpenID Connect Opens the Door to SAS Viya APIs. I checked with Mike before I originally answered your question. He's the true SME on OAuth.

 

Thanks,

Joe


Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1149 views
  • 0 likes
  • 3 in conversation