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 XXXVI, Data Simulation
Wednesday, December 13, 2023, 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 XXXVI, Data Simulation
Wednesday, December 13, 2023, 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 XXXVI, Data Simulation
Wednesday, December 13, 2023, at 10 a.m. ET | #SASBowl

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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