GoogleApps Provisioning API to move a user from one organization to another - google-app-engine

i have a use case to move a user from one Organization to another. The Api i am using is provisioning API. Managing Org Users gave an example for lab. Can anybody please share more info on what jar's need to be used to implement this. My rest of code is able to manage the other user functionallity.
My Code is in java
I am using jars gdata-appsforyourdomain, gdata-client, gdata-core and gdata-collect. These jars dont have any API's to manage the organizations with users. It would be great help if any one can share docs or any sample data on this use-case. Thanks

I was able to figure out the way by going through the source code of the labs and deployed the same.
AppsPropertyService service=new AppsPropertyService(applicationName);
service.setUserCredentials(adminUserName,Password);
GenericEntry entry = new GenericEntry();
entry.addProperty("oldOrgUnitPath",oldOrg);
entry.addProperty("orgUnitPath", newOrg);
service.update(new URL("https://www.google.com/a/feeds/orguser/2.0/"+cutomerId+"/"+MailIdofUserToBeMoved), entry);
customerid- is the unique key of the admin.

Related

How to work with "Identity Management Systems"?

This is my first question, so I hope I don't miss a thing. To be clear from the start: I don't expect an answer which dives deep into detail. This is just about getting a general understanding of how to work with this kind of software.
So I don't know if "Identity Management System" is a suitable term for what I mean but when I talk about Identity Management Systems I think of something like Azure AD, which as far as I know provides e.g. web developers the possibility to integrate a way users can authenticate (including access privilege etc.) on their website.
What I'm quite unsure about is how to work with/ integrate such tools in a project. I will try to make it clear with an example: Assuming I have a website let's say this website is a blog. The blog consist of different posts which are stored in my own database which is connected to the website. The posts are written by different users which authenticate with a tool like Azure AD. The user's data is stored somewhere on a server run by e.g. Microsoft. If I want to display the posts togethere with the name, email.... of the user who wrote them, how would I do this?
Is it possible to query the user's data directly from the Identity Management System and display it? This does not sound ideal to me as the consequence would be that data the website uses is stored in two different locations.
Would you kind of copy the user's data from the Identity Management System to the websites database and query it from there? This does not sound like a good solution either because then data would be duplicated.
So whats the "right workflow"?
I appreciate any hints and further information I can get:-)
AFAIK To get the user's information like name, email etc. you can add these claims while generating the JWT token.
To generate access token, you have multiple authentication flows such as Authorization code flow, ROPC flow, Implicit flow.
To add the claims that you need to return with the token, you can make settings like below:
Go to Azure Portal -> Azure Active Directory -> App Registrations -> Your app -> Token configuration -> Add optional claims
When you decode the token via JSON Web Tokens - jwt.io you can find the user information that you need.
To know how to generate access token, you can refer SO Thread which I solved it before.

how to access database API to fetch the records

I am using grails and as my projects requirement I want to store companies database in my own project database.In order to do that I want to use companies database api's, but i don't know much about database api's.Can someone suggest me a way.thanks in advance..
tl;dr: build a REST service to deal with the other data source
I was having similar scenario, so let me tell that if it can help you.
scenario:
In the company I work for, we are building a Grails app for another company (lets call it company_b). So company_b has its own data warehouse and they want to push some of the data to the application I built.
N.B has its own developers.
The solution I came up with:
Looking at their database I designed the appropriate tables, and shared my db schema with the developers on company_b, then I build kind of REST API to expose the tables I designed( the domain objects). So then the developers on company_b developed an API to consume the rest API I built and they are now able to send any record or any operation(delete,update,etc..).
I used json, its structure looks like this.
{
"user": {
"username":"username",
"password":"password"
},
"operation":"INSERT",
"objectName":"Employee",
"objectId":"employeeId",
"object": {
"employeeId":"1212",
"phoneNumber":"0923335227",
"dateOfBirth":"12/7/1982"
}
}
Look at the user object above ^.
The requests that come to consume the REST API are skipped from the spring authentication and I use the user object to manually authenticate each request.
I hope it will give you some insight, but this might not be the right fit for your scenario. Refer the web a lot docs out there.

The suitable way to import data to CRM ( Smartsheet) from website?

I'm doing wordpress website. And what i wanna do is: when user send contact form ( include their information) or user register, their information is added to CRM directly.
What i wonder is :
1) I should write my own plugin to do these things? possible? Because I think it will get the problem of permission ( when access to CRM)
2) There is a contact plugin which data is saved to database. Can we do cron tab to add data every period of time?
Can I ask you guy:
Are 2 above ways possible?
Are there any easier and possible way to do?
Really appreciate your help.
It's quite possible for Smartsheet to receive such information through the Smartsheet API. To help you get started with connecting to the API with PHP, and sending data to your sheet, I recommend looking at the Smartsheet Platform PHP Samples.
For your particular situation I would look at the Sheet Structure sample.

Salesforce Triggering an External Procedure

I'm not 100% sure of the terminology on how to describe what I'm looking to do, so I apologize in advance.
I have a custom entry page for an object in salesforce, and I'm curious as to whether or not it's possible to call an external website when I click the save button.
Rough Example:
User enters in a new Account and hits save.
After saving the Account, The extender class calls to a webpage that inserts an entry into an external database to let a different set of users external to salesforce know that something new has been created.
Again, I apologize. I know I'm not describing this very well. Thank you for any and all input!
Yes, it is possible. Take a look at the Invoking Callouts Using Apex section of the Apex Code Developer's Guide. Salesforce refers to this (your Apex code connecting to another web server) as an HTTP Callout.
Also, take a look at questions with the "callout" tag on the dedicated StackExchange site for Salesforce.com.

Determine whether a user is a developer of a facebook app

I'm looking at ways to secure the admin section of my (cakephp powered) Facebook application. To avoid duplicating functionality, I thought it'd be neat to allow access to people who have been flagged as developers in the app settings.
The question could then be: How do I determine whether a user of my Facebook application is a developer?
Alternatively: How do I obtain an array of developer user IDs for my Facebook app?
I tried looking for your answer myself, and the only thing I found that you could possibly do is to make a group private and invite-only to developers and then use the fb:if-is-group-member tag. http://wiki.developers.facebook.com/index.php/Fb:if-is-group-member
OK, so I found out how to do it by myself. Props to Samuel for giving me the idea.
Basically, the way to do it is to run an FQL query that establishes whether a user is an admin of the applications page (page_admin).
SELECT uid FROM page_admin WHERE uid = 286302657 AND page_id = 31290624157
In the PHP client, this returns an array for developers and an empty string for anyone else.
I decided to use the FQL rather than the API call because it is possible to preload the FQL to reduce calls to the Facebook servers.
Hope this is useful to somebody.

Resources