How can an InfoPath form get the Claims of the user who is logged in to SharePoint? - sharepoint

We have a document library that contains a list of proposals (InfoPath Forms). Users log in through SharePoint using Claims (Forms Auth, via an Extranet) who are from various organizations. The forms open in InfoPath on the client. The InfoPath form contains a field for what organization the proposal belongs to (a select list) that the user then selects when filling the form.
We have written a custom claims provider that augments each user's login with an organization claim.
When the user opens a proposal from SharePoint in the InfoPath form filler, we'd like to:
Pre-populate the organization select list with the organization
matching the user's claim
Restrict the saving of the form (inserting and updating) if the
user's claim value for organization does not match the selected
organization on the form
I'm wondering how to get the claims information in InfoPath. Or, for ideas on how to do this server-side using a custom workflow/event receiver/web service (or something else).

Here is a basic tutorial for getting claims from SharePoint 2010. Place this in the code behind of your InfoPath form. http://msdn.microsoft.com/en-us/library/ee535731.aspx
Ideally you want to call the code from the FormEvents_Loading method of your InfoPath form and if the user's organization is invalid, create a bool, that if false, will prevent the form from submitting. This would be done in the FormEvents_Submit method.

I'm not sure if this works for your specific implementation however, you can set the data source for input controls (drop down lists, list boxes, etc) to be retreived from a web service.
You can then use hidden fields on the eForm which are populated with the metadata you need such as the user Id. These values are subsequently passed to the webservice and the return (List or whatever) are bound to the desired controls within the eForm.

Related

What is the best way to handle sensitive data in PowerApps and Lists?

I have only been using PowerApps for about a year now and I've received a request to create an application that compares tables based off of an existing Access database. The big concern is that the existing database has sensitive data in its inputs (specifically, credit card numbers). We do not currently have Dataverse, so I've been using SharePoint Lists for my tables, but my experience has been that we have to give full read/write access to each table to each app user, so simply not displaying the sensitive data is insufficient for security purposes. How can I protect the data but still allow access to the tables in the application?
Here is a scenario may help you have a reference:
User A can see an item in the list, but user B cannot see it in the list.
(1) The item has unique access to user A.
(2) The current view contains a filter, only showing file which is created by A.
(3) The file may in draft status and B is unable to see the draft.
In list settings -> versioning settings, when enable 'Require content approval for submitted items?', you could set specific user to see the draft items (items which is in pending status)

Azure B2C Linking Different Permissions to Users

We have a problem where individual user are registered to our application but with permission to see a single set of data. These are all setup as local accounts.
At the moment each user is associated with a single set of data.
We now need to be able to link different sets of data to the same user.
After or during login the user would be presented with the options that are linked to their account and it would remember this throughout their session.
We would also need to be able to add new permissions to an account through an API.
What is the best way of achieving this through Azure B2C ideally without using custom policies if possible.
If you want to insert a page during the authentication journey (sign in) which reads the users access ability, and then allow the user to choose one of these options, and then issue that choice in the token, you will need a custom policy. I am assuming that this list could be different for each user ("options that are linked to their account").
If that list of options is stored on the user object, then it needs to be read from the user, and a dynamic radio box selection be presented to the user.
You need to create a comma delimited list and insert it into a claim, if its already stored as comma delimited, or some other delimited list, then you are already good to go. Otherwise youll need to have B2C send the data to a Rest api to build a comma delimited list.
That claim needs to be shown on the page after 'sign in' in a text box via B2C (hidden with CSS), where javascript on your custom HTML page (configured in B2C) builds a radio box from that list in the hidden text box.
Then the javascript needs to record the choice into another B2C rendered text box. You should then verify at B2C or via Rest api whether the submitted value was valid.
Then issue that value into the token.

Pre-populate contact information

If a person has previously filled out a contact us form on our website, the next time they visit that form I would like their information pre-populated. Using Kentico EMS and the form builder, how can I make that happen?
you can access the contact informant via macros or custom macro methods and place it in the contact form default values (I would use an alternative form), but often you do not know if the user already exists unless they are logged in or enter the same email (which you would then need to add a client side trigger to Ajax an api once the email field is filled out, check for that contact in the api, return json of their info and populate the form).
to build the api you can either use the Kentico rest service or if you need more flexibility use the web part to api coupled with a repeater with custom query, adding the right where condition through macros.

Duplicate fields on signing interface

I am building up an envelope using multiple templates through the API using CreateEnvelopeFromTemplates.
Sometimes the server side templates used to build the envelope contain the same logical fields
e.g. two templates used, both have fields of "Account Number"
How do I make it so when the signer enters data in one account number field, it updates the other account number field with the same data immediately in the signing interface?
It is required to prevent the signer from typing one account number on one document then a different account number on the other document in the same template.
The business logic for the document requires this so removing the duplicate account number fields would not be an option either.
There's an account-level setting that you can configure in DocuSign to force this behavior (i.e., ensure that like-named fields throughout all Documents in an Envelope always contain the same values). Simply login to the DocuSign web console (as a user with Administrator rights), navigate to "Preferences >> Features" and on the Features page, set Data Population Scope to "Envelope". (See page 27 of the DocuSign Admin guide: http://www.docusign.com/sites/default/files/Account%20Administration%20Reference%20Guide.pdf)
Because this is controlled via DocuSign account-level setting, there's nothing special you need to do in your CreateEnvelopeFromTemplates API call -- just configure the account setting and you should be good to go.

SharePoint 2010 and the GetGroupCollectionFromUser operation in InfoPath

I am working on an InfoPath 2010 form which will be submitted to a SP2010 instance and filled out via a web browser. I am trying to present different views of the form based on the SP User group that the current user belongs to.
On form load I want to check a form status field and check to see if the current user belongs to an approval group. This group is a SP usergroup and from what I can tell the UserGroup.asmx webservice and the GetGroupCollectionFromUser operation is the one I want. However, within InfoPath 2010 after I add the data connection the only result field seems to be userLoginName. This does not seem to be what I want, or if it is, I don't know how to get at the group list contained in that value.
How can I get at the list of SharePoint groups returned?
You need modify the xml schema of the web services:
This post shows how to do it:
http://blog.symprogress.com/2011/05/infopath-list-form-hidedisable-fields-based-on-sharepoint-group-membership/

Resources