How to configure adfs for sharepoint online? - sharepoint-online

we have user credentials in an on-premise ADFS.we have adfs installed on a machine,how to establish trust between sharepoint online and adfs?How do we get adfs url that authenticates user credentials and generates security token?

You need to Set up a trust between AD FS and Azure AD. Run the powershell:
Connect-MsolService
Set-MsolAdfscontext -Computer <AD FS primary server>
Convert-MsolDomainToFederated –DomainName <domain>
Below article would be helpful to you:
https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Step-By-Step-Setting-up-AD-FS-and-Enabling-Single-Sign-On-to/ba-p/295302
https://azure.microsoft.com/en-us/resources/videos/configuring-ad-fs-for-user-sign-in-with-azure-ad-connect/
https://blogs.msdn.microsoft.com/sambetts/2014/09/09/setup-sharepoint-online-on-premises-single-sign-on-sso/

Related

Issues connecting to Microsoft Exchange online using PowerShell - app only authentication

I could not connect to Exchange Online, I get the below error while connecting
Error Acquiring Token:
System.Exception: In the case of a Federated user(that is owned by a federated IdP, as opposed to a managed user owned in an Azure AD tenant)
ID3242: The security token could not be authenticated or authorized.The user does not exist or has entered the wrong pas
swordInnerException : Federated service
PowerShell Code
$AppCredential= New-Object System.Management.Automation.PSCredential(<UPN>,<Token>)
Connect-ExchangeOnline -Credential $AppCredential
Reference
https://o365reports.com/2020/07/04/modern-auth-and-unattended-scripts-in-exchange-online-powershell-v2/
Connect to Exchange Online using App-only authentication Feature is not available in EXO V2.
Delegation is not possible with app-only authentication. The Secure App Model allows for unattended scripting in delegation scenarios.
Delegation is not supported in this Feature.
Note: Decrease your EXO V2 into V1 then you can use the same scripts to connect the Exchange Online using APP-only Authentication.. But This way is not recommended.
Refer here

why adfs configuration required DC administrator

I plan to configure ADFS on my SharePoint server. I have separate AD DC. While configuring adfs in SharePoint it require my DC Admin password, Shall I give the admin password to configure, if this affects my AD schema or any changes?
Why the admin password is asking while configuring adfs
Your valuable reply helps us a lot.
ADFS creates some entities on the DC to store passwords etc.
It needs domain admin rights to do this.

Verify ADFS federation with Azure AD

In relation to this question:
Azure AD graph API using on-premise domain
I have set up an federation between the on premise ADFS and Azure AD using the Azure AD connect tool. In the last step of the verification I ran into this:
I believe that it is because the ADFS needs to somehow be exposed to the internet. Probably using an proxy server. In the Azure portal the Domain is now marked as federated. I have tried to do a post to https://login.microsoftonline.com/{domain}/oauth2/token, it works when I use xx.onmicrosoft.com users created directly an the Azure AD domain. When I use a user#{domain} user syncronized from the on premise AD I still get
""error": "invalid_grant",
"error_description": "AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password....." like I did before I set up the federation. I would actually expect to be somehow redirected to the on premise login screen
So two questions:
Is it nessesary to have the ADFS exposed to the internet via a proxy for the federation not to fail?
How can I properly test logging in to Azure AD using the on premise user?
Thanks in advance :)
-Dan
As an answer to my own questions.
What I was trying to do was have my customers users in my azure ad domain. What that means is that the customer cant have their own Azure AD or office 365 as the domain can only exist once on Azure. So this is not at solution.
Use https://{domain}/adfs/ls/idpinitiatedsignon

federate azure active directory with on premise ADFS

I'm trying to federate on premise ADFS 3.0 instance with Azure Active Direcotry instance. The idea is to allow AAD (azure) users to authenticate to an application which trusts the ADFS instance.
I added azure AD to claims provider trusts in ADFS (using it's federation metadata document path)
then I create an application in AAD which has identifier of the ADFS (e.g. https://fs.somedomain.com/adfs/services/trust
ADFS instance then correctly displays AZURE as special realm.
The only thing I can't figure out is what should be the reply url in azure application settings, so the ADFS instance redirects authenticated request to correct application.
It's the normal adfs/ls.
You just need to configure the URL and URI.
Refer: Azure AD as IdP with AD FS as RP.

ADFS 2.0 with SharePoint not recognized as trusted application and throwing

I am configuring a POC for SharePoint with authentication to third party account provider and running into several issues and following the documentation provided by microsoft at http://technet.microsoft.com/en-us/library/cc731443(v=ws.10).aspx. Most of the documentation which I have seen are for ADFS 2.0 RTW
The issue is when I am a trying to the access the SharePoint site, I get redirected to the account provider ADFS site with NTLM prompt pop up. Once when I enter my credentials I get the following error
The token request for application with URL "https://spadfsweb.spdev.com/_layouts/Authenticate.aspx?Source=/" cannot be fulfilled because the URL does not identify any known trusting application.
Here is my setup
ADFS account provider (ADFS Role and DC are in separate machines)
Windows 2008 R2
ADFS role added
Has the following parameters for the ADFS
token signing certificate "sts.adfsaccount.spaccount.com"
Federation Service URI
urn:federation:accountprovider
Federation service endpoint url
https://sts.adfsaccount.spaccount.com/adfs/ls/
Exported the token signing certificate and imported that in resource partner ADFS
ADFS Resource Partner (ADFS role and DC are in separate machines)
Windows 2008 R2
ADFS role added
Has the following parameters for the ADFS
Token signing certificate "sts.staging.spresource.com"
Federation Service URI
urn:federation:resourceprovider
Federation service endpoint url
https://sts.staging.spresource.com/adfs/ls/
Has the following trusted application which is sharepoint
https://spadfsweb.spdev.com/_trust/, I have all sort of the combination like below
https://spadfsweb.spdev.com
https://spadfsweb.spdev.com/_layouts
Exported the token signing certificate and imported that into account partner ADFS
And below is the steps how I have configured the SharePoint site
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\Data\Certs\stsadfsaccount_exporttokensign.cer")
New-SPTrustedRootAuthority -Name "Account Token Signing Cert" -Certificate $cert
$map = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming
$map2 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" -IncomingClaimTypeDisplayName "Role" –SameAsIncoming
$ap = New-SPTrustedIdentityTokenIssuer -Name "Staging Provider"-Description "User account domain from adfs to provide authenitcation" -Realm "urn:federation:resourceprovider" -ImportTrustCertificate $cert -ClaimsMappings $map,$map2 -SignInUrl "https://sts.adfsaccount.spaccount.com/adfs/ls/" -IdentifierClaim http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
---SharePoint has the uri of resource provider, signing certificate of the account partner and adfs url of the account partner
Please let me know if I am doing something wrong.
Thanks
Deepak
You seem to suggest you're using ADFS 1.0. And indeed, if you followed http://technet.microsoft.com/en-us/library/cc731443%28v=ws.10%29.aspx as you say, then you've configured ADFS 1.0, as opposed to the successor AD FS 2.0. In my opinion any new deployment should be using AD FS 2.0.
Your error message is described on the ADFS 1.0 troubleshooting page; quoting:
Condition: server error
Error: The token request for application with URL https://... cannot be fulfilled because the URL does not identify any known trusting application
Solution: This error is returned by the resource Federation Service when the application URL does not identify any known application. Make sure that the application has been added to the trust policy for the Federation Service. For more information about how to do this, see Complete the Add Applications Wizard.
For a claims-aware application, verify that the return URL is typed correctly in the application’s web.config file and that it matches the application URL that is specified in the trust policy of the Federation Service.
For a Windows NT token-based application, verify that the return URL is typed correctly on the ADFS Web Agent tab of IIS and that it matches the application URL in the trust policy of the Federation Service.
Also, in case you don't know already, for ADFS 1.0 Microsoft created the ADFS Diagnostic Tool; see this blog post to download. This tool might prove useful in tracking down this specific problem.
Hope this helps...

Resources