can't route /admin to user/login if not login in cakephp - authentication

i want to create a admin routing enabled program in cakephp and i had aleray enable
Route::Write(/admin,array('controller'=>admin_homes,'action'=>'index')) in route .php but when i type /admin it doesnot redirect me to my login page in users/login address so what is solution to this but if i custom go into my login page and login in then it will redirect to admin/admin_homes/index and then only using/admin will also take me to admin_homes/index

You want more than admin routing, you are looking for Authentication. That is what controls the login, not admin routing. Admin routing is for running the admin variation of specific methods.
Start here: http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html
If you are looking for a simple user management app with permission driven access, feel free to use the one I created and put out on github. https://github.com/cdburgess/SUM-Cake

Related

Is it possible to use a subdomain login page to authenticate apps on multiple subdomains?

I'm looking to setup a login page on a subdomain for use with Auth0. Is it possible to have that login page serve auth for multiple other subdomains?
For example:
I want login.xyz.com to be the auth page for:
dev.xyz.com
staging.xyz.com
production.xyz.com
It is possible to set up your login page to provide authentication for different subdomains (you could even set it up for different domains). One thing you have to remember is that a user will only have to log in once, and then will use their session among the different subdomains. This is because the user will actually log in to login.xyz.com and the other subdomains will only get a confirmation from your authorization server that the user is authenticated (most probably in the form of an ID token, if you're using OpenID Connect).

Add extra params on Cognito Hosted UI callback url

I am trying to implement the login process in my app using Cognito Hosted UI.
I want if user is not logged in and try to access a page
www.example.com/a
To be redirected on the hosted UI page, and after login I want to redirect the user on his initial request www.example.com
How can I achieve this?
maybe I misunderstood your question, but this is not something you should be able to do directly from cognito, the initial "catch-all" redirection should happen on your site's code.
Once you redirect it to your Cognito hosted UI, which should be a URL similar to this one:
https://{your cognito domain}/oauth2/authorize?client_id={your client id}&response_type=code&scope=aws.cognito.signin.user.admin+email+openid+profile&redirect_uri={your site's url}
Once the auth process is finished it will redirect the user back to you site.I need to point out that first you need to add your site's url in the list of allowed Callback URLs in your app client.
I wish I could be of more help, but how to handle auth on your app is very dependant on the technology you're using, if it helps you this thread discusses how to do this with nuxt and #nuxtjs/auth-next, this will probably give you some more insight into how to approach your problem

Redirect user if not logged-in in Kentico

I am very new to Kentico CMS and started implementing the basics.
I have Login button webpart which redirect me to page say 'Welcome.aspx'.
Now, what I am struggling with is if directly open 'Welcome.aspx' without login,
it should redirect to another page. Can anyone please help me in doing this?
If I understood correctly, you want the Welcome.aspx to require users to log in. If so, you can achieve that by adjusting page's ACLs at Page -> Edit -> Security and setting the Website logon page URL at Settings -> Security & Membership.
You can either set the page to be accessible by certain roles or at least require authentication.
There is an example in Corporate sample site - in section Partners.
Assuming you are using the recommended Portal Engine development model, you can set the permissions of the page on the Properties>Security tab. There you'd add a role of not authenticated and set the property to deny. Also ensure you have a default "login" page set in the settings.

Subdomain cookie maintenance for Forms authentication website

I have a Server on Azure where an MVC4 web application is hosted. On the server I have added bindings for:
company1.mysite.com
company2.mysite.com
Within mysite an Admin user has the option to define custom styles for each of the subdomains. So to check the changes have been applied successfully. If the admin changes the URL from company1.mysite.com to company2.mysite.com they are redirected back to a login page. When I then attempt to log in with the same details it seems that there is some conflict in the cookies and I am unable to find the user details.
Is there anyway that I could preserve the login details for one subdomain and allow the user to simply change the URL to see if the changes had been supplied effectively. If not is there any way I can prevent this conflict on signing on to the other subdomain?
I think cookie domain must be specified in a proper way. Please, see this link

How to achieve triggered redirect after log in so that administration interface will be available on the redirected url? Drupal 7

I would like to ask for an advice. Recently, I was developing a conference site with Drupal 7. The site is hosted at domain1.com. However, the conference is covered by another organization and they require that conference page will be accessible from their own domain something like.: organization.com/conference2014 Fortunately, Drupal has base_url parameter and the site is accessible from organization.com/conference2014 domain. BUt, my problem is when I want to access administration interface of Drupal through organization.com/conference2014?q=user/login I get redirected to organization.com site which is administrated by the organization admin. Moreover, when I access again organization.com/conference2014 - it still asks me for the password.
I got adviced to introduce trigger after the user successfully logs in to the site organization.com/conference2014. It does redirect me but the administration interface/overlays is not there. Any ideas how to tackle this problem?
Martin
Your session cookie is associated with the domain you logged in at, so if you login at domain1.com you will not be logged in at organization.com. I'm assuming organization.com has a RewriteRule configured for conference2014 which points to your domain? If so, they can configure the redirect to pass the query string with the redirect, like this:
RewriteRule ^conference2014/?(.*) http://domain1.com/$1 [L,NE,QSA]
(QSA is the piece which we're interested in, it is "Query String Append")
This will allow you to access http://organization.com/conference2014?q=user etc.