I'm trying to implement GoogleDrive into my .net application
but on the tutorial i'm using from http://www.daimto.com/google-drive-authentication-c/ it says that it simply send the user to a login page of GoogleDrive but the question is where ? i don't see any code that sends the user to a login page.
so my question is how can i let the user authenticate before starting of?
Trying several days now and i don't have a clue how to do it.
hope someone can point me to the right direction.
What you are looking for is called External Authentication Services with ASP.NET Web API. MVC supports many external providers and is reasonably easy to implemented them within Visual Studio and a MVC project.
For implementing a login from ASP.NET have a look at the OAuth 2.0 Web applications (ASP.NET MVC). You can also have a look at this MVC tutorial MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on C# - it contains exactly what you ask for - a redirect to the Google login page.
The Access-URL's are embedded into the Nuget-Package Google.Drive.API.v2/Auth/Client - when you use the assembly/the classes the url's are internally known:
A thorough explanation (and also the URL's when using pure REST to access the service) could be found here GDrive .NET Quickstart and here Using OAuth 2.0 for Server to Server Applications
Related
I want to build a web application where a user logs in using his windows account through a login form. In this application I'm gonna have to use LDAPS (and not LDAP). I've been searching on internet for a tutorial to guide me but I found some code snippet on forums of people that are having trouble with their code. I couldn't understand where to put that code or why I should put it especially that I'm very new to ASP.NET.
Could you please provide me with some information or links that can help me ?
Also should I use ASP.NET MVC or ASP.NET WEB API?
I have been searching for an example on how to add a security layer for all our currently running web applications which have been developed in ASP.NET MVC and Web API. The requirement has come from the top for the current new API which will be used by some of our applications but at the same time allowing a user to use one identity.
I have been scouring the internet the whole day watching videos and reading blogs, but I cannot find a solid step by step guide and that is not ASP.NET Core based, that is easy to understand, up to date, perhaps visual and with the correct technologies to use. I have come across two main ones and not sure how they are really interlinked, i.e. IdentityServer 4 and OAuth 2, but I do understand both individually.
Does anyone have a good example or tutorial I could follow that also include authorization. Our current user store is in a SQL Server database, and the end goal is to create one security token service to authenticate all the applications and carry forward claims in JWTs. Please assist?
I have some issues with authentication and authorization in Asp.Net Core.
My aim is to use the [Authorize] attributes of Asp.Net core for controlling access to an Web API.
Unfortunately only a LDAP and SAMBA server are available for user managment.
Is there any simple way to integrate one of these with Asp.Net Core?
Or is there any workaround, e.g. a simple OAuth 2 provider that just needs to be plugged onto LDAP or SAMBA?
I tried IdentityServer 3 and 4 but all documentation and samples have a lot of UI related code, so I cannot really find the keypoints of using it.
At the moment only a backend exists, so a sample or way to achiev this without any GUI component would be ideal.
My question is based on ASP.net 5 and authentication. In particular, I'm trying to achieve integrating oAuth (2.0) into my solution as my logon method (the users can either logon using oAuth if this is how they registered, or directly with my own app). Using the template for an ASP.net 5 web app, I've successfully achieved the above but this isn't quite what I need.
I'm have an ASP.net 5 MVC (app1) for my front end UI and an ASP.net 5 web api application (app2) for my REST services, serving data to the UI. Nothing new to this approach.
I want my MVC front end (app1) to have no Entity Framework references and no reference to things like Sign in manager (if possible). Just keeping it as simple as possible. I have a login screen and I want to present the option to logon via facebook or google oAuth accounts. Instead of using the nice code MS kindly provides out of the box when you start a new ASP.net 5 web app (hey, why make life easy!), I want to use my web api to do as much as the work as it can (I realise somethings need to happen in app1 to make this work).
My goal is to keep my UI as simple as possible and offloading complex functionality (business logic, database access and other things such as caching) off to the web api app.
I'm having difficulties extracting the parts of the web app demo around oAuth, and moving it into the web api, to utilise from app1. Has anyone managed to do this before? Is this a bad idea? Has anyone a sample of this approach in new ASP.net 5 MVC.
Thanks for advice in advance!
We (that is ASP.NET) recommend you look at Identity Server. v4 is now built on top of .NET core. The OAuth components you see in templates for facebook, twitter et al aren't suitable for using against a WebAPI, they're there for interactive, browser based logins, not for javascript.
You would have your interactive app handle registrations as normal, then use Identity Server to issue a bearer token, pointing it to your identity database, and validate that within your WebAPI.
We don't recommend rolling your own.
You can build a WebAPI app with membership manager using ASP.NET Identity. ASP.NET Membership is now called ASP.NET Identity.
From the link you will see how you can create a WebAPI app that will support all basic ASP.NET membership functionalities (log-in, register, etc).
Once you have WebAPI setup with your (custom) ASP.NET membership storage (DB is auto-generated once you run the app.), you are set up with a RESTful web layer with data access. You can also customize the storage provider. See here: Overview of Custom Storage Providers for ASP.NET Identity.
The ASP.NET website (www.asp.net) has all the necessary information sufficient to create all that you said from scratch. For integrations with Facebook or others, you can check out this link: External Authentication Services with ASP.NET Web API (C#)
I have an ASP.NET MVC app. I want link a Twitter user's account to a user account in my app. Previously, I was using Twitterizer. However, from my understanding, that library will no longer work because Twitter changed their authorization approach. With that in mind, what library is a C# developer recommended to use?
Does anyone know of a library that a C# developer can use to get a Twitter users access secret and access token?
Thank you
In new ASP MVC 4 template you have all work done and ready to use:
http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx
You'd be hooking into their authentication system using OAuth. There are some pretty effective libraries for this kind of thing for .NET, check out twitter's dev site for the most up to date ones:
https://dev.twitter.com/docs/twitter-libraries