2012-11-22 31 views
14

में ADFS टोकन प्राप्त हम एक ADFS 2.0 पर्यावरण कि कार्यालय के साथ हमारे सक्रिय निर्देशिका डोमेन में सम्मिलित करने के लिए प्रयोग किया जाता है 365Powershell

हाल ही में हम एक समस्या हुई जहां क्लस्टर जवाब है जो बदले में के लिए ई-मेल/कैलेंडर पहुंच तोड़ दिया बंद कर दिया है हमारे सभी उपयोगकर्ता। हम ADFS के लिए किसी भी निगरानी की जरूरत नहीं है के रूप में वर्तमान में मैं एक PowerShell स्क्रिप्ट जो समय-समय पर हमारे ADFS क्लस्टर के लिए प्रमाणित करने के लिए प्रयास करते हैं और testexchangeconnectivity.com काम करता है पर एसएसओ परीक्षण करने के लिए इसी तरह की एक मान्य टोकन प्राप्त होगा लिखने की कोशिश कर रहा हूँ।

ऐसा लगता है कि वास्तव में टोकन

/adfs/सेवाओं/विश्वास/2005/usernamemixed

द्वारा जारी किया जाता है, लेकिन जब भी मैं के खिलाफ आह्वान-webrequest या नए-वेब सेवा प्रॉक्सी चलाने का प्रयास यह यूआरआई और स्थानीय एडी प्रमाण पत्र प्रदान करता है मुझे 400 खराब अनुरोध त्रुटि मिलती है।

क्या मैं क्रम में करने के लिए इस अंतिम बिंदु से एक टोकन ठीक से अनुरोध करने के लिए क्या है?

उत्तर

0

यह स्क्रिप्ट अपना रास्ता http://gallery.technet.microsoft.com/scriptcenter/Invoke-ADFSSecurityTokenReq-09e9c90c आप नेट फ्रेमवर्क 4.5

की आवश्यकता होगी आप भी Office 365 कनेक्ट-MSOL cmdlet का उपयोग एक powershell सत्र से कनेक्ट करने के लिए एक ADFS लॉगऑन अनुकरण कर सकता है पर आप मिलना चाहिए - यदि आप एडीएफएस खाते का उपयोग करते हैं तो एक एडीएफएस लॉगिन होगा।

0

अनिवार्य रूप से, आप WSTrustChannelFactory उपयोग करते हैं, एक चैनल बनाने, और यह एक RequestSecurityToken गुजरती हैं।

Leandro एक अच्छा, संक्षिप्त sample

आप .NET 4.5 का उपयोग नहीं कर रहे हैं विंडोज पहचान फाउंडेशन (WIF) स्थापित करने के लिए की आवश्यकता होगी है।

0

मैं एक उत्पाद है कि फ़ेडरेटेड प्रमाणीकरण WS-संघ और WS-ट्रस्ट का उपयोग कर करता है पर काम करते हैं। मेरा मानना ​​है कि आपका केस हमारे वर्कफ़्लो का हिस्सा है।

सालों से, मैंने अपने एसओएपी आधारित एपीआई के खिलाफ पावरशेल ऑटोमेशन विकसित किया है, और कुछ बिंदु पर मैं उस ज्ञान को गैलरी पर उपलब्ध WcfPS मॉड्यूल में समेकित करता हूं।

code मॉड्यूल के लिए खुला स्रोत है और हालांकि इसकी लिपि में यह भारी .net फ्रेमवर्क वर्गों और विधानसभाओं पर System.ServiceModel और System.IdentityModel विधानसभाओं से निर्भर करता है। मैं इसका जिक्र करता हूं क्योंकि उन असेंबली के अंदर अधिकांश एपिस .NET मानक 2 से उपलब्ध नहीं हैं, इसलिए मॉड्यूल दुर्भाग्य से गैर विंडोज ऑपरेटिंग सिस्टम काम नहीं करेगा। आप इसके पोस्ट WCFPS - PowerShell module to work with SOAP endpoints में इसके बारे में और भी पढ़ सकते हैं।

यह एक उदाहरण है जहाँ आप अपने सेवा प्रदाता आवश्यकताओं के आधार पर और पार्टी विन्यास भरोसा सममित और वाहक टोकन जारी कर सकते हैं है। कोड को संघीय सुरक्षा प्रवाह, सेटअप और शब्दावली की बुनियादी समझ की आवश्यकता है।

# Define the ADFS MEX uri 
$adfsMexUri="https://adfs.example.com/adfs/services/trust/mex" 

#region Define authentication endpoints. One for windows and one with username/password 
$windowsMixed13AuthenticationEndpoint="https://adfs.example.com/adfs/services/trust/13/windowsmixed" 
$usernamePasswordMixed13AuthenticationEndpoint="https://adfs.example.com/adfs/services/trust/13/usernamemixed" 
#endregion 

#region Define service providers for which we want to issue a symmetric and a bearer token respectively 
# Symmatric is for SOAP, WS-Trust 
# Bearer is for Web, WS-Federation 
$soapServiceProviderAppliesTo="https://myserviceprovider/Soap/" 
$webServiceProviderAppliesTo="https://myserviceprovider/Web/" 
#endregion 

# Parse the MEX and locate the service endpoint 
$issuerImporter=New-WcfWsdlImporter -Endpoint $adfsMexUri 

#region Issue tokens with windows authentications 
$issuerEndpoint=$issuerImporter | New-WcfServiceEndpoint -Endpoint $windowsMixed13AuthenticationEndpoint 
$soapToken=New-SecurityToken -Endpoint $issuerEndpoint -AppliesTo $soapServiceProviderAppliesTo -Symmetric 
$webToken=New-SecurityToken -Endpoint $issuerEndpoint -AppliesTo $webServiceProviderAppliesTo -Bearer 
#endregion 

#region Issue tokens with username/password credentials 
$credential=Get-Credential 
$issuerEndpoint=$issuerImporter | New-WcfServiceEndpoint -Endpoint $usernamePasswordMixed13AuthenticationEndpoint 
$soapToken=New-SecurityToken -Endpoint $issuerEndpoint -Credential $credential -AppliesTo $soapServiceProviderAppliesTo -Symmetric 
$webToken=New-SecurityToken -Endpoint $issuerEndpoint -Credential $credential -AppliesTo $webServiceProviderAppliesTo -Bearer  
#endregion 

 संबंधित मुद्दे

  • कोई संबंधित समस्या नहीं^_^