Authentication url is missing resource parameter

Hi, I'm playing around with swagger data source and authentication against azure ad and msgraph api

The authentication uri is in the following format:

https://login.microsoftonline.com/common/oauth2/authorize/?client_id=bdf7831d-0000-4265-0000-7b5d42866af3&response_type=token&scope=${scopes}&redirect_uri=${redirectUrl}&resource=00000003-0000-0000-c000-000000000000

where 'resource' is the resource to request an access token.

Is it possible to add resource as parameter to the swagger parameters (and the same for rest)?

Another option is also to allow any custom suffix to the uri that will be appended to the full uri. So we can add any parameter to the uri. For example

CustomUriSuffix = 'resource=xxxx-xxxx-xxxx&nonce=graph_explorer&prompt=select_account'

Or a 3th option, like you do with scopes, a parameters field, where we can add custom parameter and value records
resulting in the following sample json:

{
  "securityDefinitions": {
   "MyDataSource": {
   ...
   parameters :
   {
    resource :'xxxx-xxxx-xxxx',
    nonce : 'graph_explorer',
    prompt : 'select_account',
   }
...
}

tx
Bart

Hi Bart,

This is a great idea!

Is the resource parameter changing at runtime or is it a constant? It is easy to add a custom list of parameters in the OAuth configuration but those would be constants. Would that work? If yes we can bake this up with the next weak’s release.

Regards,
Atanas

Hi @korchev

The resource parameter is a constant.
But it would be great to make a difference depending on the environment.
So in 'dev' or 'production' (or other environments), the resource parameter will be different.
The same for the client_id.

So if the settings could be stored in the angular environments.xxx.ts file, that would be great solution.
In that case we can differentiate the setting on the environment we are building for.

In the Authorization service you get for example the following:

const url = `${environment.MyCustomAuthUri}?' + environment.MyCustomAuthParameters.join('&');

Thanks!

I see what you mean. Will update this thread once there is progress on the implementation.

Best,
Atanas

Thanks

In the meantime, do you think it is possible to add a custom list of parameters in the next release?

For now, I have to change the uri in vscode every time.

nb: I like to post also another issue, but i have to wait 24 hour when I try to post a new one

Yes, it is possible to add the custom list of parameters for the next release. Being able to specify different values for production could ship after that though.

1 Like

@bartnetjs I have just increased the number of topics a user can create in their first day. You should be able to start a new topic.

1 Like