Federated authentication and Delegated authentication in salesforce - salesforce

Anybody know the difference between Federated authentication and Delegated authentication in salesforce? Can you explain the flow of request in these two methods?

The main difference is the use of Security Assertion Markup Language (SAML) on Federated Authentication.
Delegated Authentication Use delegated authentication if you have mobile users in your organization, or if you want to enable
single-sign on for partner portals or Customer Portals. You must
request that this feature be enabled by salesforce.com. This recipe
explains delegated authentication in more detail.
Federated Authentication using SAML Federated authentication uses SAML, an industry standard for secure integrations. Investing in SAML
with Salesforce.com can be leveraged with other products or services.
If you use SAML, you don't have to expose an internal server to the
Internet: the secure integration is done using the browser. In
addition, Salesforce.com never handles any passwords used by your
organization. For more information, see “Configuring SAML Settings for
Single Sign-On” in the Salesforce.com online help.
Difference
Delegated authentication has a few drawbacks with respect to federated authentication. First, delegated authentication is inherently **less secure than federated authentication**. Even if encrypted, delegated authentication still sends the username and password (possibly even your network password) over the internet to Force.com. Some companies have policies that preclude a third party for handling their network passwords. Second, delegated authentication **requires much more work for the company implementing it**. The Web services endpoint configured for the org must be developed, hosted, exposed on the Internet, and integrated with the company's identity store.
More detailed flow and code example on delegated
More detailed flow on SSO width SAML

Related

Is OAuth2 Authorization Code flow an authentication protocol?

According to the following documentation, I understand that OAuth2 is an Authorization protocol:
https://learn.microsoft.com/en-us/azure/active-directory/develop/authentication-vs-authorization#authorization
Considering that OAuth 2.0 authorization code flow is an authorization protocol, why in many application types and scenarios (including the code example below), authorization code flow is used to authenticate a user (using its password) then provides an access token to the application.
https://github.com/Azure-Samples/active-directory-b2c-dotnet-desktop
The confusion I have is that most OAuth2 flows use a user's password to identify her/him then provide an access token to the application.
As another example, I learned that PowerApps portal uses OAuth2 PKCE to identify users through B2C. It seems that PowerApps uses OAuth2 PKCE to authenticate users, not authenticate them. I was expecting OpenID Connect should be used for such a scenario.
Is OAuth2 Authorization Code flow an authentication or authentication protocol or both of them?
Yes, OAuth2 is an authorization protocol.
It did not provide a consistent way to authenticate and the social providers e.g. Facebook, Twitter etc. then rolled their own authentication models to provide this service.
As a result, OpenID Connect was developed. This provides a standard way to authenticate and is built on top of OAuth2.
(There was an earlier standard called OpenID for authentication but that is not often used now).
As per this:
"OpenID Connect (OIDC) is an authentication protocol built on OAuth 2.0 that you can use to securely sign in a user to an application. When you use the Microsoft identity platform's implementation of OpenID Connect, you can add sign-in and API access to your apps.
OpenID Connect extends the OAuth 2.0 authorization protocol for use as an authentication protocol, so that you can do single sign-on using OAuth.
OpenID Connect introduces the concept of an ID token, which is a security token that allows the client to verify the identity of the user.
The ID token also gets basic profile information about the user. It also introduces the UserInfo endpoint, an API that returns information about the user".
PKCE is for "OAuth 2.0 public clients utilizing the Authorization Code Grant.
These are susceptible to authorization code interception attacks.
This specification describes the attack as well as a technique to mitigate against the threat through the use of Proof Key for Code Exchange (PKCE, pronounced "pixy")".
So after authenticating with OIDC, PKCE makes the Authorization Code Grant flow more secure.

Standup a custom SAML IDP

In our organisation we implemented support for OIDC and OAuth2 support recently and we used the node-oidc-provider library to support the same. This way our product acts as an IDP that support Open IDC. We were also able to integrate our product as an IDP into our organisations instance of okta for certain scenarios.
In the same way we are planning to support SAML2 implementation in our security product that currently only supports OIDC. Is this possible and if so is it worth implementing SAML support? One of the reason to support SAML is so that we can talk to snowflake where Azure AD will use our SAML IDP to authenticate users and then provide access to snowflake.
Or the other way is to use Okta as a SAML provider and talk to snowflake. The flow would be users connect to okta and then okta will redirect certain users with a certain domain to our IDP (Supporting Open IDC) and then once that succeeds okta will use SAML to talk to Azure AD which in turn will provide access to snowflake.
Please suggest a good way. If you say we can integrate SAML support also into our existing Open IDC supported IDP what is the best library to use for nodejs.
Thanks

Azure B2B direct federation with Auth0 as IDP

Azure B2B gives simple steps for direct federation with google and facebook.Though, i don't see any documentation to establish direct federation with Auth0 or Okta. I tried myself with Auth0 at the time or invitation my user succesfully login with auth0 account but after redirection to invitation.microsoft.com getting redemtion failure.
Can someone give me steps to setup Auth0 as IDP and then configure that with Azure AD direct federation.
https://auth0.com/docs/protocols/saml-configuration-options/configure-auth0-as-saml-identity-provider
i have already setup everything as mentioned in above document but still not able to redeem invitation after login.
Any help would be highly appreciated!!!
Azure AD B2B can be configured to federate with identity providers that use the WS-Fed or SAML. There is no specific Document for direct federation either from OKTA or Azure. From Azure end Direct federation is only allowed for policies where the authentication URL’s domain matches the target domain, or where the authentication URL is one of these allowed identity providers as per this document. I recommend you to open a support case with Auth0 since it involves multiple parties.

SAML purpose and authentication in azure AD

I have to use Azure Active Directory for authentication to my web application.
In my company it was suggested to use SAML instead of oauth and I am very new to SAML.
Question:
Is the purpose of SAML is only to authenticate or there is any more functionality?
There are documents to use SAML in enterprise application. So,How to implement saml from app registration?
SAML SSO is a form of delegated authentication. The user is authenticated at the identity provider site (eg Azure AD) which sends a SAML assertion containing user identity information to the service provider site. The service provider trusts this information and establishes a local authentication session for the user using the information contained in the SAML assertion. SAML assertions often contain the user's email address but any user identity information may be included. This is the primary use case for SAML and in many instances the only one supported.
Most platforms have SAML libraries etc available. It's strongly recommended you use one of these rather than trying to implement SAML yourself.

Does Microsoft Active Directory have an option to be an identity provider?

I’m looking to integrate with a SSO IdP (identity provider) and trying to understand whether AD can serve that role.
I.e., I set up users on AD, users authenticate on a webpage that checks the validity of their password with AD which generates a signed token I can use to log into my app.
Thanks!
Yes, AD can be easily used as an Identity Provider for Single Sign on purpose.
If you're going for it, achieving Web single sign on (SSO) through Microsoft's AD FS (Active Directory Federation Services) would be a good choice.
I'll quote the overview from MSDN Article on Active Directory Federation Services:
Overview
AD FS is a standards-based service that allows the secure sharing of
identity information between trusted business partners (known as a
federation) across an extranet. When a user needs to access a Web
application from one of its federation partners, the user's own
organization is responsible for authenticating the user and providing
identity information in the form of "claims" to the partner that hosts
the Web application. The hosting partner uses its trust policy to map
the incoming claims to claims that are understood by its Web
application, which uses the claims to make authorization decisions.
AD FS is Microsoft's implementation of the WS-Federation Passive
Requestor Profile protocol (passive indicates that the client
requirements are just a cookie- and JavaScript-enabled Web browser).
AD FS implements the standards based WS-Federation protocol and
Security Assertion Markup Language (SAML).
... // follow the link shared above for more information.

Resources