Package org.pac4j.testkit
Class OAuthScenarios
java.lang.Object
org.pac4j.testkit.OAuthScenarios
Pre-assembled HTTP test scenarios for OAuth2/OIDC authorization code flow.
Requires mock-oauth2-server running. The consumer starts it before tests,
passes its URL, and stops it after.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidrunAuthorizationCodeFlow(String serverUrl, no.nav.security.mock.oauth2.MockOAuth2Server mockServer) Full authorization code flow: GET /protected -> redirect to IdP -> follow redirects through authorize -> callback -> /protected -> 200static voidrunUnauthenticatedRedirect(String serverUrl, String mockOAuthServerUrl) Verify unauthenticated access redirects to the IdP's authorize endpoint.
-
Method Details
-
runUnauthenticatedRedirect
public static void runUnauthenticatedRedirect(String serverUrl, String mockOAuthServerUrl) throws IOException Verify unauthenticated access redirects to the IdP's authorize endpoint.- Throws:
IOException