Handle the browser requests to all the resources

This topic has 1 reply, 1 voice, and was last updated 7 years, 3 months ago by JLS.

  • Author
    Posts
  • #3901
     JLS
    Participant

    Hello,
    I’m trying to configure OpenIG to display the Google home page when the user opens: http://<openIG>/login
    I don’t need the redirect, it’s a test for future porpouse.
    I configured this route:

    {
            "handler": {
                    "type": "Chain",
                    "config": {
                            "filters": [
                                    {
                                            "type": "StaticRequestFilter",
                                            "config": {
                                                    "method": "GET",
                                                    "uri": "http://www.google.com"
                                             }
                                    }
                            ],
                            "handler": "ClientHandler"
                    }
            },
            "condition": "${matches(exchange.request.uri.path, '^/login')}"
    }

    if I try to open http://<openIG>/login, the browser display the Google web page, but without images.
    The reason is that all the resources that the browser requests after the main page (images, CSS, javascript) are required to: http://<openIG>/<resourcelocation&gt; instead of http://google.com/<resourcelocation&gt;.

    What can I do to handle the complete sequence of browser requests inside the same route?

    Another “strange” thing is that when the browser requests http://<openIG>/<resourcelocation&gt;, there is no response, the default route (that is a static response) doens’t receive the request.

    Thank you

    #3906
     JLS
    Participant

    I could use a DispatchHandler inside the 99-default.json route in the way below, but if I want to use OpenIG to protect different web sites (e.g. /login to access google and /yahoo to access yahoo”) how can I do?

    {
    	"handler": {
    		"type": "DispatchHandler",
    		"config": {
    			"bindings": [
    				{
    					"condition": "${exchange.request.uri.path == '/login'}",
    					"handler": {
    						"type": "Chain",
    						"config": {
    							"filters": [
    								{
    									"type": "StaticRequestFilter",
    									"config": {
    										"method": "GET",
    										"uri": "http://www.google.it:80"
    									}
    								}
    							],
    							"handler": "ClientHandler"
    						}
    					},
    					"baseURI": "http://www.google.it:80"
    				},
    				{
    					"handler": "ClientHandler",
    					"baseURI": "http://www.google.it:80"
    				}
    			]
    		}
    	}
    }
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?