PingFederate login mechanism - authorization code flow - google-chrome

My application is configured to get the access_token from the authorization code sent by the IDP. Below is the flow:
I request an organization application(sp).
Organization application redirects me to the IDP login page, Here I enter the username and password.
After successful authentication, IDP redirects me to the organization application URL with auth code appended in the request param.
Now organization application saves this code in the application session and then gets the access_token using the auth code provided by IDP.
if I again request the organization application(SP), the application checks if the session has the auth code, and if it has, it will not redirect me to the IDP login page to get the auth token. This is how the application works in the context of login.
Now if the session expires, and we request the organization application, this time application directly redirects me to the IDP to get the authorization code, without a username and password.
My question is how this magic is happening, How does it get the user info from my browser?
I thought it might be using cookies to get user info, but after deleting all cookies from the browser, it could still get auth code without asking me to put username and password.
From where it is getting the user information? I tried it with chrome and edge browsers and the result is the same for both.
Using the PingFederate for IDP.

The IDP (or authorization server, or both, depending on the exact setup) issues a session cookie after the user authenticates. If you perform an RP initiated logout, or clear all IDP cookies, this force a re-login.
If the IDP session cookie remains valid, the user will not be prompted for credentials the next time they are redirected to authenticate. Eg if the application session / token lifetime is shorter than the IDP session time.
Often this is best resolved by configuring the app's refresh token and IDP session time to be the same. Applications can also send the OpenID Connect prompt=none parameter at any time to force re-authentication.

Related

ReplyUrl of Authorization Server not found

I am self-hosting the api management developer portal using a custom domain name via a Azure CDN and storage account. Authentication is provided using Azure AAD B2C. We have configured an authorization server to request access token using authorization code flow. When we access the managed site it correctly requests the access token and processes it using the reply url "https://apim-instance-name.developer.azure-api.net/signin-oauth/code/callback/name-of-auth-server", however, when we use the custom domain name it returns 404 not found when AAD B2C redirects the browser to https://custom-domain-name.com/signin-oauth/code/callback/name-of-auth-server". Is there something I'm missing?
Screenshot of redirected browser not finding reply url

Jmeter sharepoint login issues

i'm using Jmeter to perform some tests on a website with the login in sharepoint.
The problem i'm facing is about the login: it has to be performed by the chrome mask (photo attached).
If i do it manually, obviously no problem.
If i try it by jmeter i obtain always error401.
In order to perform it, i've tried by using the jmeter recorder, but it doesn't perform the login because of the proxy.
So i've tried with the chrome plugin and it has correctly recorded everithing, giving me a get request only and adding to my plan an HTTP Authorization Manager with:
BASEURL: my_link
USERNAME: MyDomain\MyUsername
PASSWORD: MyPassword
DOMAIN is empty
REALM is empty
MECHANISM: basic
So, trying to launch the only get that i have, with the following header manager:
it always gives me error 401:
I've also tried by moving the domain from the username tab to Domain and removed the date header from the header manager of the get.
I've also seen that the recording from blazemeter plugin gives to me a get with an header manager with the field "authorization" compiled with "Basic and the key calculated starting from username and password" and is a Basic type.
But if i remove that authentication header and launch again, the requestheaders doesn't contain anymore a basic authorization (with the relative code) but a NTLM request with a bigger code.
What i'm doing wrong? How can i perform correctly the login?
I believe you need to change "Mechanism" to BASIC_DIGEST for NTLM authentication (if you're sure that it's really NTLM)
However it is better to inspect request and response headers, it will allow you to identify which authentication protocol is being used under the hood.
For NTLM you need to supply: username (without domain), password, domain and mechanism (BASIC_DIGEST)
If it is Kerberos - you need to choose KERBEROS mechanism, specify the realm and perform the appropriate configuration in jaas.conf and krb5.conf files (both live in "bin" folder of your JMeter installation
More information: Windows Authentication with Apache JMeter

CAS Authenticate through another subdomain

At my place of employment, we do not control what applications are CAS authorized, but have existing CAS authorization for an application hosted at foobar.com/app-one.
When a user signs into this, they are correctly authenticated, and are served the application.
Recently, we have added a new application, foobar.com/app-two. Unfortunately when signing in, the user is served a message "Application Not Authorized to use CAS". For reference, both of these have CAS server validation disabled.
However, if a user accesses foobar.com/app-one, authenticates themselves, then navigates to foobar.com/app-two, the page is served without issue.
How would I have an unauthenticated user access app-two, get directed to the authorized login component of app-one, and then be redirected to app-two?
EDIT: Could I pass a new redirect location in my request or something similar?

Mail server rejecting default credentials in smtp settings for asp.net 4.0 healthMonitoring

I have successfully set up health monitoring for logging errors on my ASP.NET web page to the Windows Event Log, a SQL Server database, and through email (Microsoft Exchange) when I specify a user name and password in the web.config file. However, if I change from specifying a user name and password to defaultCredentials="true" in web.config, I get the following error message in my Windows Event Log when it tries to generate the email:
System.Web.HttpException (0x80004005): Unable to send out an e-mail to the SMTP
server. Please ensure that the server specified in the <smtpMail> section is
valid. ---> System.Net.Mail.SmtpException: Mailbox unavailable. The server
response was: 5.7.1 Client does not have permissions to send as this sender
I am running Windows Vista on a corporate domain. My Windows login is identical to my Microsoft Exchange login. Can anyone provide some insight as to why specifying my login credentials explicitly in the web.config file works, but using defaultCredentials="true" does not? Are there any known solutions so that I can have an automated email sent through healthMonitoring without having to store my user name and password in the web.config file?
Since I earned the tumbleweed badge for this question, I doubt an answer will be of much value to anyone else; but knowing that I will inevitably fall into the same trap at a later date, I thought I would post an answer to my own question...
Authentication is not necessary for sending emails within the same domain; so instead of specifying defaultCredentials="true", I removed all fields related to authentication, and the emails began working again.
Note that this is only a partial solution. I only need to send emails to addresses within the same domain for now. Sending emails outside of this domain will not work without authentication, so if/when that is needed, it will be back to the drawing board...

user reamins login in social networking site using my application

I want to develop an app. I want to integrate linkedIn account with my app. As the user logs in my app he one authenticate his linkedIn account and next time whenever he logs in he automatically login with linkedIn also
How I can achieve this.
either saving the id and password of user or the only access token???
After allowing a user to connect with LinkedIn (via their OAuth API), you need to store the LinkedIn OAuth token in your database, separate from the user's session. Then when the user logs in again you can just get the token from your database and continue making authenticated requests to LinkedIn.