Wildcard subdomain priority for Google AppEngine - google-app-engine

I want to use the functionality of dispatch.xml to route my request by subdomain and create a default module which will receive all the non specified subdomain.
I explain myself:
Let's say I have 3 differents modules:
Module 1 routed from: m1.myapp.com
Module 2 routed from: m2.myapp,com
Default Module routed from anything else: *.myapp.com (like: default.myapp.com, *entitieName*.myapp.com, other.myapp.com).
My question: is there any kind of priority mechanism that will handle first written subdomain and if and only if the subdomain called isn't in the dispatch.xml it will route the request to my default module?

Yes, you already have such priority mechanism - that's exactly how dispatch.xml works:
the order of the dispatch rules matter, the first pattern match wins and the request will be dispatched according to that rule
if none of the rules matches the request will be sent to the default service/module.
Something along these lines should do what you desire:
<?xml version="1.0" encoding="UTF-8"?>
<dispatch-entries>
<dispatch>
<url>m1.myapp.com/*</url>
<module>m1</module>
</dispatch>
<dispatch>
<url>m2.myapp.com/*</url>
<module>m2</module>
</dispatch>
</dispatch-entries>

Related

(SalesForce SAML) Is it possible for SAML authNrequest to override Assertion Consumer Service url(ACS)

I'm trying to use the same salesforce app with multiple SAML service providers. All of the service providers have the same identifiers, the only things that I need from sales force is to send the SAMLResponses to Assertion Consumer Service(ACS) that I specify when I construct the authNresponse request.
When I construct the SP initiated an authentication request to SF I include the ACS URL(as AssertionConsumerServiceURL field) in the SAMLRequest token, but it doesn't seem to override the ACS URL that is mandatory in the connected apps SAML settings.
Maybe there is a way to override the ACS URL?
Not sure about SalesForce but in general, yes we can. Just add the AssertionConsumerServiceURL="xxx" tag to the AuthNRequest. I just tried this myself (with Optimal IdM). Unless SalesForce has restrictions in place that don't accept overriding, this is possible.
So a sample AuthNRequest would look like:
<samlp:AuthnRequest Version="2.0" IssueInstant="2018-06-29T14:46:11.33Z" ForceAuthn="false" IsPassive="false" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceURL="xxxxxxx">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">xxxxxxx</saml:Issuer>
</samlp:AuthnRequest>
PS: I know it's an old thread, but answering anyway for the sake of others.

Infinite Redirect with OKTA

I have a simple php application which displays a form for user onboarding. I used SimpleSamlPhp as the SP and OKTA as the IDP. I get an infinite redirect when I access the url of the application. These are my settings in OKTA:
My application's url is:http://service.example.com/Analytics/ui/onboard.php. The same url is set for PostBack url, destination, recipient and Audience Restriction
On the SP-side I have this piece of code:
require_once('/Applications/XAMPP/xamppfiles/htdocs/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth();
Is there something that I am missing?
It's confusing, I know. What you need to do is use special SimpleSAMLphp URLs for the SAML configuration of your application.
In particular, the URLs that you use in Okta will need to point to specific SimpleSAMLphp URLs.
Here is a screenshot of how I have SimpleSAMLphp configured in Okta:
In this example, the URL for the "Single sign on URL" ends in simplesamlphp/www/module.php/saml/sp/saml2-acs.php/example and the URL for the "Audience URI (SP Entity ID)" ends in simplesamlphp/www/module.php/saml/sp/metadata.php/example. These URLs will be specific to where you installed SimpleSAMLphp on your web server.
Note that these URLs both point to SimpleSAMLphp endpoints and that they are nearly the same URL, except that one points to saml2-acs.php and the other points to metadata.php. In both of these examples, the string "example" is what refers to the string you used to configure the SAML IdP in the config/authsources.php file, and by extension, the metadata/saml20-idp-remote.php file.
The "Default RelayState" field is where you will want to enter in the URL for your PHP code, that is, the file you wrote that includes SimpleSAMLphp. This is where you will want to put your http://service.example.com/Analytics/ui/onboard.php URL.
Configuring SimpleSAMLphp
I found that adding configuration to the config/authsources.php and metadata/saml20-idp-remote.php files in SimpleSAMLphp was overly complicated, so I wrote some code to make that configuration a little bit easier. This code, and instructions for using it, are available on GitHub here: https://github.com/jpf/okta-simplesamlphp-example

AngularJS app - Google Analytics Default URL?

We have written an AngularJS application and want to begin tracking correctly.
In the Admin section of our GA page for this site, what would be the Default URL if our application url looks like this:
http://www.example.com/srv/Home/OLTest#/pSignIn/test%5E4599/1189608/42
The app begins at Home/OLTest, anything after the # is parameters for the app. pSignIn is our initial controller.
The default URL field should be your hostname without the trailing slash:
https://support.google.com/analytics/answer/1042508
The default URL value used to be used for things like pre-populating your tracking code cookie domain (before using 'auto' was supported) as well as cross-domain configuration. But I believe now it's only used for content links in your reports.
So, given your example, the default URL should be: http://www.example.com (without the trailing slash).

google Gae php: Custom Not Found Url

I am using google app engine to upload my php files.
For example this is my testing url http://testing12399234.appspot.com/index.php , whenever the url is not found i want the page to point to http://testing12399234.appspot.com/index.php , for example visiting http://testing12399234.appspot.com/randomblabla12312 must show contents of http://testing12399234.appspot.com/index.php . I know its possible via .htaccess .But how to use .htaaccess in google GAE
The app.yaml file holds the handlers for your application. The first handler that matches the requested URL is used to serve the request. In the linked documentation the last handler is:
- url: /.*
script: not_found.php
So this will match any URL that hasn't already been matched, and send it to your custom not found page. Just make sure it is the last handler in your configuration file, or it will take precedence over other handlers.
Google AppEngine PHP AppConfig documentation

How can I override the CXF services list URL?

My webservice has an REST endpoint URL like /myapp/admin/services. If I set org.apache.cxf.servlet.hide-service-list-page=false then my URL is hijacked by the CXF services list. This happens because the listings URL is relative in org.apache.cxf.transport.servlet.ServletController.
OK, fine, so I shouldn't have used the phrase "services" in my URL structure. Mea culpa. But now how do I fix this? I'd like to override the "/services" default in ServletController. I just need my container to invoke setServiceListRelativePath() on that class, but I can't figure out how. I imagine there's some magic Spring snippet to do this?
If it matters, I'm using CXF as bundled in the Talend Service Factory.
(turning my comment above into an answer, and modernizing since TSF no longer exists)
Under Karaf, add the following to etc/org.apache.cxf.osgi.cfg: "org.apache.cxf.servlet.service-list-path=/desired/path"
You can try this in your web.xml to override the CXF service list path
<init-param>
<param-name>service-list-path</param-name>
<param-value>/*</param-value>
</init-param>

Resources