I am able to use admin SDK API and using C# standalone code and I am able to implement below operation as well.
Create User, Upadate User, Create Group, Add Membership, remove membership, reset password etc.
However I have a requirement where we need to perform bulk upload of group & users into Google. Please advice if there is any sample code or API which I can use to implement the same.
Regards,
Anurag
If you're looking for a solution to bulk user management and you're using .Net or C#, check out my gShell project which wraps the APIs with easy-to-use PowerShell cmdlets. Using this you could do something like easily reading a CSV file or calling against an LDAP environment and calling a cmdlet like Get-GAUser or Set-GAUser to make the necessary changes. You'll need to be working on a Windows OS to get the PowerShell working and you'll need some basic PoSh knowledge, but it's pretty straight forward otherwise.
It also has an option to use the gShell authentication framework in your own .Net project if you need to customize things a bit more or make an executable.
If you're looking for samples of C# code it's open source so browse away.
Related
I am writing a ToDo list Winform application and I would like to use the the One Note API in order to save the information about the tasks in the user Microsoft account.
So I browsed the One Note API documentation but after a few hours of research I did not manage to find a good entry point.
I understand that the first step for me would be to sign the user which is described on this page:
https://msdn.microsoft.com/en-us/library/hh826543.aspx
The thing is that the different ways of achieving that step don't seem suitable for a Winform client application, maybe I should use the rest API ?
I have been looking for a .NET code example but have yet to find any so I'm quite confused right now...
Thanks for any help !
You can use the OneNote API - signing in can be achieved by using a webcontrol and having the user follow the sign in flow there. Unfortunately we don't have any sample code for winforms, but the auth flow in our NodeJs sample for the OneNote API should be similar.
https://github.com/OneNoteDev/OneNoteAPISampleNodejs
You could also (assumming the user has OneNote installed) use the OneNote interop libraries to interact with OneNote and store/retrieve your data there.
How To Write To A OneNote 2013 Page Using C# and The OneNote Interop
You might also want to try developing a universal app instead of a windows forms application:
https://github.com/OneNoteDev/OneNoteAPISampleWinUniversal
I have a C# web application and I want clients to allow files insert/ update/ delete files with automatic authentication using google api client library. My first question is whether it is possible possible or not using "Service account" or any other technique.
I have started things like:
Enabled 2 APIs Drive API and Admin SD
Created a project in the Google Developers Console
Created API keys and OAuth 2.0 client IDs for the project
Installed PM> Install-Package Google.Apis.Drive.v2 for my web app. The dll version is showing v4.0.30319 and
my .net framework is 4.0
If you want to modify a user's Drive, you will need the user to be at least connected and also that he gives to you the permissions to do so.
The best way to learn how to do this is the Google Drive API, they provide a good start-up and a lot of samples for the tasks you ask for : Google Drive REST API, .NET quickstart.
If you still hits problems, there is also others way to learn : a simple google research gives good results.
For exemple, Daimto have a tutorial for exactly what you need :
Authentication
Retrieve files informations
Upload, update, delete files
Finally a project sample
If you still hit a problem, a little research helps a lot, then ask question here.
So I'm trying to find a "Best" way to interact(create a interface) with Active Directory read/write mode. So I'm deciding between this two aproaches:
Try and use the ADWS.
C# Implementation.
Apparently for ADWS is not that easy even though there is a full WSDL I'v not been able to locate it, to try to do some test via SOAPui...
Now fort the C# Implementation there are few implementations
but still I'm not sure if its 100% doable to have full READ/WRITE to AD i.e. creating accounts users, query for users info, etc. from lets say REST WS.
So My questions are
Is there a way of getting a WSDL from the AD server so that I can use that as a starting point? ( I don't want to get me into PowerShell stuff or the like)
Are there any good articles for the latest versions C# ,libs, etc... to help me implement this?
Is there a better way of doing this?
As an example This is what we're trying to do:
Scenario 1:
Create a Web Service (INTERFACE) that expose AD information
The Web Service could be REST or SOAP
The WS should read/Query/Write the AD
Any Application inside the network can consume the WS
Scenario 2 (What we currently plan to do):
Sharepoint Reads AD Information
Job should copy AD to DB
Applications can read this data
There should exist some replication between the DB and AD
Any suggestions will be more than welcome
I'm Using server 2008R2 ,Sharepoint foundations 2010
I'm assuming this is related to your previous question which mentioned Exchange.
My personal suggestion is to host a WCF service in IIS. You can set this service up to do whatever you want to suite your needs for the apps accessing it. You can probably do most of what you need to do through the System.DirectoryServices.AccountManagement namespace when it comes to User and Groups.
System.DirectoryServices will give you more granular control at the cost of more work. However, it is a little easier and reading and writing from/to custom attributes here.
If you're going to interact with Exchange 2010 you'll need to mess with Powershell. And you could use Powershell to do core AD work as well.
And of course if you're going to write your own web service you could make it REST.
Here is a link to MSDN with info about System.DirectoryServices and the various namespaces. I personally find AD to be a lot of fun to work with. There are many ways to do the same thing in it so I don't think there's one right answer for you. Go with what you're comfortable with or challenge yourself to do something new!
I want to use Google Webmaster Tool API in c# application. I have gone through different documents that are available on https://developers.google.com. Unfortunately I did not get any working example of using Google WT API using .Net . I have also seen the “Client Libraries” (“https://developers.google.com/gdata/docs/client-libraries”) for this.
Can anybody provide me any working example of how to use Google Webmaster Tool API in c# ?
I have account on Google WT, and want to download .CSV reports for “CrawlErrors”, “InternalLinks”,” TopSearchQueries” etc.
Thanks
Here you can find the official C# library source code for Webmaster Tools Data API:
http://google-gdata.googlecode.com/svn/trunk/clients/cs/src/webmastertools/
And here you can find examples of usage in the form of unit tests:
http://google-gdata.googlecode.com/svn/trunk/clients/cs/src/unittests/webmastertools/
More specifically, examples of authentication, QuerySites, QuerySitemaps, QueryKeywords, etc.:
http://google-gdata.googlecode.com/svn/trunk/clients/cs/src/unittests/webmastertools/WebmasterToolsServiceTest.cs
Note also there are some bug reports, your mileage may vary:
http://productforums.google.com/forum/#!topic/webmasters/gh7vCzYfm6A
If you're still getting 403 Forbidden, the reason behind this might be the 2-Step Verification installed on your Google account. If that's the case, try generating a dedicated password in the Application-specific passwords section of your Google account, and use it with GDataCredentials(this.userName, this.passWord).
Alternatively, you may try adding sub-accounts at https://www.google.com/webmasters/tools/user-admin and use of one of them. The 2-Step Verification concern may apply to those accounts, too.
What the the Open source Library available in the C#.NET for the SSO.
Basically I want to connect with Google SSO then will further continue with other providers.
Check out: DotNetOpenAuth
Also, you may want to check the following links:
http://msdn.microsoft.com/en-us/library/ms972971.aspx
http://weblogs.asp.net/hernandl/archive/2004/06/09/ssoformsauth.aspx
The Windows Identity Foundation (WIF) is Microsoft's official library for identity federation.
In your scenario you can also use Access Control Service (ACS) to federate identity with Google, Yahoo!, etc. All of them (and more) are supported out of the box.
Samples, documentation, etc. available here: http://claimsid.codeplex.com
If you have a bit more control over your servers, Shibboleth might be an option as well. It actually simplified a large portion of our application that serves thousands of users and it is well thought out, flexible, and scalable. Basically, define a directory that should be watched for credentials and Shibboleth takes care of the rest.
You should use DotNetOpenAuth, as stated in Kamyar's answer. If you want to see a whole implementation using DotNetOpenAuth and other series of auxiliary libraries, you should have a look at this article:
Integrating OpenID in ASP.NET Web Forms using DotNetOpenAuth