I have tried to get a SAML token from ADFS to pull data from on-premises CRM (non-sdk), but I don't know how..I think I need to make a SOAP request to ADFS to get a SAML token by using postasync method, and then I think I need to put the token in a http header like below to pull data from CRM.
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", TOKEN);
https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/255985/crm2016-afds-authentication
https://gist.github.com/jlattimer/7b0ee146badfc57fc9c9
I have read those three links above (and other stuff), and tried them but it seems like the first two work only for sdk, not non-sdk. And, the github stuff didn't work for me, either. And I wonder if there is another way to generate a SOAP request instead of typing in everything like in the third link.
ADFS is an Identity Provider (IDP) and implements:
Your client has to implement one of these three protocols.
You can't use SOAP.
For OpenID Connect (OIDC), you can use a REST API but that gives you a JWT, not a SAML token.
Once you have the access token via OIDC, you add it as ("Bearer", TOKEN) as you describe.