Agent Guides › SAML Affiliate Agent Guide › SAML Affiliate Agent Overview › Introducing the SAML Affiliate Agent › Communication Across the Federated Network › Scenario 2: User Visits Consumer Before Visiting the Producer
Scenario 2: User Visits Consumer Before Visiting the Producer
When the user visits the consumer first, the consumer and the producer communicate as follows:

The communication flow is as follows:
- A user tries to access a resource at the consumer before logging in at the producer.
- The Affiliate Agent redirects the user to a URL at the producer (known to the Affiliate Agent as the PortalQueryURL). The SAML Affiliate Agent appends the SSLInterceptorURL and the target resource to the URL.
- At the producer, the user is sent to the AuthenticationURL, and prompted to log in. If the log in is successful, the AuthenticationURL invokes the redirect.jsp file, which redirects the user back to the PortalQueryURL.
- The PortalQueryURL is now invoked with a session and the assertion generator produces a SAML artifact, which references an assertion.
- The Web Agent at the producer returns the user to the consumer with the artifact appended to the protected redirect URL, known as the SSLInterceptorURL.
- The Affiliate Server uses the artifact to request the assertion from the producer.
- The producer returns the assertion to the consumer. The SAML Affiliate Agent then creates a session for the user.
The SAML Affiliate Agent validates the assertion, produces a local session cookie, and sets headers based on information from the assertion.
- Finally, the user is directed to the originally requested target URL.