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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 2024, at 10 a.m. ET | #SASBowl

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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