ADFS Claims Based Rules - "check if SAM account exists within Active Directory Store"

%3CLINGO-SUB%20id%3D%22lingo-sub-78780%22%20slang%3D%22en-US%22%3EADFS%20Claims%20Based%20Rules%20-%20%22check%20if%20SAM%20account%20exists%20within%20Active%20Directory%20Store%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78780%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%202%20domains%20in%20our%20scenario%2C%20one%20is%20%5CINT%20and%20the%20other%20one%20is%20%5CRSC.%20one%20ad%20fs%20and%20one%20AD%2FDC%20are%20hosted%20in%20each%20domain%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20configured%20the%20INT's%20AD%20FS%20as%20a%20cliam%20provider%20and%20RSC's%20ADFS%20as%20a%20relying%20party%20between%20the%20two%20AD%20FS%2C%20and%20we%20chose%20'pass%26nbsp%3B%3CSPAN%3Ethrough%20the%20windows%20account%20name(SAM%20account)%20as%20a%20claim%20'%20from%20INT's%20AD%20FS%20as%20the%20claim%20rule%20to%20RSC's%20ADFS.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENow%2C%20after%20receiving%20the%20incoming%20claim%20on%20the%20RSC's%20AD%20FS%20%2C%20we%20would%20like%20to%20check%20if%20the%20value%20of%20that%20incoming%20claim(SAM%20account)%20exists%20in%20the%20RSC%20Domain%2C%20we%20would%20use%20Active%20directory%20as%20a%20store.%20If%20yes%2C%20w%20would%20issue%20an%20attritube%2C%20Role%20into%20the%20claim%20and%20pass%20to%20SharePoint.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20my%20case%2C%20all%20the%20user%20accounts%20which%20are%20inside%20the%20INT%20domain%20are%20also%20exist%20in%20the%20RSC%20domain.%20(e.g.%20Assume%20tom%20and%20mary%20are%20two%20domain%20user%20accounts%20inside%20INT%2C%20so%20the%20two%20user%20accounts%20which%20are%20tom%20and%20mary%20are%20also%20exist%20inside%20the%20RSC%20domain).%20After%20INT's%20ADFS%20has%20authenticated%20Tom%20idenity%2C%20it%20would%20pass%20the%20claim%20which%20contains%20SAM%20account%20to%20RSC's%20ADFS%3B%20now%20%2C%20instead%20of%20just%20pass%20through%20all%20incoming%20claims%20to%20sharepoint%2C%20we%20would%20like%20to%20issue%20a%20role%20claim%20if%20RSC%20Domains%20contains%20a%20SAM%20account%20called%20Tom.%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAny%20one%20know%20how%20to%20write%20a%20rule%20claim%20language%20on%20the%20RSC's%20AD%20FS%3F%20should%20I%20config%20it%20on%20the%20ClaimProvider%20Trust%20of%20the%20RSC's%20AD%20FS%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMy%20drafted%20code%20is%20shown%20as%20below%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Ec%3A%5BType%20%3D%3D%20%22%3CA%20href%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Fwindowsaccountname%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Fwindowsaccountname%3C%2FA%3E%22%5D%3CBR%20%2F%3E%3D%26gt%3B%20issue(store%20%3D%20%22Active%20Directory%22%2C%20types%20%3D%20(%22%3CA%20href%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Frole%26quot%3B%2C%26quot%3Bhttp%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Fwindowsaccountname%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Frole%22%2C%22http%3A%2F%2Fschemas.microsoft.com%2Fws%2F2008%2F06%2Fidentity%2Fclaims%2Fwindowsaccountname%3C%2FA%3E%22)%2C%20query%20%3D%20%22sAMAccountName%3D%7B0%7D%2CRole%3BDOMAIN%5CRSC%22%2C%20param%20%3D%20c.Value)%3B%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDoes%20anyone%20can%20help%20me%20to%20improve%2Fcorrect%20the%20above%20code%3F%20Thanks%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-78780%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

We have 2 domains in our scenario, one is \INT and the other one is \RSC. one ad fs and one AD/DC are hosted in each domain

 

We have configured the INT's AD FS as a cliam provider and RSC's ADFS as a relying party between the two AD FS, and we chose 'pass through the windows account name(SAM account) as a claim ' from INT's AD FS as the claim rule to RSC's ADFS.

 

Now, after receiving the incoming claim on the RSC's AD FS , we would like to check if the value of that incoming claim(SAM account) exists in the RSC Domain, we would use Active directory as a store. If yes, w would issue an attritube, Role into the claim and pass to SharePoint.

 

In my case, all the user accounts which are inside the INT domain are also exist in the RSC domain. (e.g. Assume tom and mary are two domain user accounts inside INT, so the two user accounts which are tom and mary are also exist inside the RSC domain). After INT's ADFS has authenticated Tom idenity, it would pass the claim which contains SAM account to RSC's ADFS; now , instead of just pass through all incoming claims to sharepoint, we would like to issue a role claim if RSC Domains contains a SAM account called Tom. 

 

Any one know how to write a rule claim language on the RSC's AD FS? should I config it on the ClaimProvider Trust of the RSC's AD FS?

 

My drafted code is shown as below:

 

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=> issue(store = "Active Directory", types = ("http://schemas.microsoft.com/ws/2008/06/identity/claims/role","http://schemas.microsoft.com/ws/2008/..."), query = "sAMAccountName={0},Role;DOMAIN\RSC", param = c.Value);

 

 

Does anyone can help me to improve/correct the above code? Thanks

0 Replies