Oauth 2.0 enable in swagger with .net core web api

88 views
Skip to first unread message

sushant jha

unread,
Jun 5, 2017, 1:37:07 PM6/5/17
to Swagger
Hi All,
Can anyone suggest me? How Oauth 2.0 enable in swagger with .net core web api .Actually before all apis expose i need to redirect swagger url to login screen. Its really urgent.

Regards
Sushant

Ron Ratovsky

unread,
Jun 5, 2017, 5:57:53 PM6/5/17
to swagger-sw...@googlegroups.com

For language specific implementations, you’d need to ask the relevant project. In your case, I’m guessing it would be Swashbuckle.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sushant jha

unread,
Jun 6, 2017, 12:30:33 AM6/6/17
to Swagger
Hi Ron,
Thanks for reply. I have tried this. With the help of this,after exposing APIs on swagger UI ,Authorize button come up.Then Oauth get enabled. But i need to redirect my API Url i.e. localhost:8080/swagger to login screen((login.microsoft.com)  (not custom login page ) ,where it will check for authentication . Without using swagger, my web API URL use to redirect and check, but In case of swagger ,its not.
 I have gone through tutorial ,but i haven't got any relevant solution . Kindly help.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Jun 6, 2017, 11:59:32 AM6/6/17
to swagger-sw...@googlegroups.com

Got it.

 

I don’t know which version of swagger-ui you use, but if it’s the latest, you can set up the redirect url.

Check out the parameters you can use - https://github.com/swagger-api/swagger-ui#parameters

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

sushant jha

unread,
Jun 6, 2017, 12:39:53 PM6/6/17
to swagger-sw...@googlegroups.com

Thanks Ron,
I am using swashbuckle.asp.netcore 1.0.0

i have clicked on given link .Where i suppose to find the solution in that link.Should i have to go through all the issues.?

Please suggest ,Its really running out from my deadline.

Thanks
sushant


To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/R4VtCZz_78Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Jun 6, 2017, 12:49:01 PM6/6/17
to swagger-sw...@googlegroups.com

No, I gave you a link to the parameters you can use in swagger-ui. I don’t know which version you use.

The information of what to edit is in the README.

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of sushant jha <shis...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Tuesday, 6 June 2017 at 9:39
To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Subject: Re: Oauth 2.0 enable in swagger with .net core web api

 

Thanks Ron,


I am using swashbuckle.asp.netcore 1.0.0

i have clicked on given link .Where i suppose to find the solution in that link.Should i have to go through all the issues.?

Please suggest ,Its really running out from my deadline.

Thanks
sushant

On Jun 6, 2017 21:29, "Ron Ratovsky" <r...@swagger.io> wrote:

Got it.

 

I don’t know which version of swagger-ui you use, but if it’s the latest, you can set up the redirect url.

Check out the parameters you can use - https://github.com/swagger-api/swagger-ui#parameters

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of sushant jha <shis...@gmail.com>


Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Monday, 5 June 2017 at 21:30
To: Swagger <swagger-sw...@googlegroups.com>

Subject: Re: Oauth 2.0 enable in swagger with .net core web api

Hi Ron,

Thanks for reply. I have tried this. With the help of this,after exposing APIs on swagger UI ,Authorize button come up.Then Oauth get enabled. But i need to redirect my API Url i.e. localhost:8080/swagger to login screen((login.microsoft.com)  (not custom login page ) ,where it will check for authentication . Without using swagger, my web API URL use to redirect and check, but In case of swagger ,its not.

 I have gone through tutorial ,but i haven't got any relevant solution . Kindly help.

On Tuesday, 6 June 2017 03:27:53 UTC+5:30, Ron wrote:

For language specific implementations, you’d need to ask the relevant project. In your case, I’m guessing it would be Swashbuckle.

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of sushant jha <shis...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Monday, 5 June 2017 at 10:37
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Oauth 2.0 enable in swagger with .net core web api

 

Hi All,

Can anyone suggest me? How Oauth 2.0 enable in swagger with .net core web api .Actually before all apis expose i need to redirect swagger url to login screen. Its really urgent.

 

Regards

Sushant

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/R4VtCZz_78Y/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

sushant jha

unread,
Jun 7, 2017, 8:11:45 AM6/7/17
to Swagger
Hi Ron,
Our requirement is that as soon as the request goes to the API Url i.e. localhost:8080/swagger ,it should be  redirected login screen((login.microsoft.com) for authentication. I have used Swagger 2.0 .
 With the link you have provided ,we are authenticating by using external html /java script files and making changes in the code base of the same which is not meeting the requirement . I have installed  swashbuckle.asp.netcore 1.0.0 and made necessary changes in configure and configure services functions in startup.cs and then enabled Oauth. 

 I have gone through the link ,but i haven't got any relevant solution . Kindly help.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/R4VtCZz_78Y/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Jun 7, 2017, 2:33:41 PM6/7/17
to swagger-sw...@googlegroups.com

If you need to protect the UI itself from being accessed and want to use OAuth2 to block it off, that’s something out of scope for the project and you’d have to implement it on your own.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/R4VtCZz_78Y/unsubscribe.

To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages