Drupal 8 Access Denied - drupal-8

I've just taken a copy of my drupal 8 database from staging and loaded this on my development enviroment.
I now get access denied when I try to login /admin
Can't find any information on why.
Update
Seems to be something to do with a twig service where the urlGenerator is not being implemented. Still no luck fixing this.

In hoster`s panel try find "IP address:" settings and change it from "Dedicated IP" (this option can have dependant "This site processes direct requests to a dedicated IP address" tick) to "Shared IP".

Without doing login in your site, you can not access the admin screen.
For example : If your site is justprogrammer.com and you try to open link justprogrammer.com/admin without login then you are not able to access the page. Before accessing the admin link, you first need to login using justprogrammer.com/user.

You cannot just access any /admin/* pages on drupal without logging in. For that you have to login from /user/login put in the username and relevant password then you can access the admin side if you really have admin role and actually logging in from admin account.
If you don't know the password for admin simply reset them to whatever you want by this drush command.
drush upwd --password="YourPassword" 1
1 is user id of admin.

Related

Sitecore website not re-directing to login

When I access my sitecore website, it seems to be authenticating some user -- i can tell because I check the cookies on my browser and see that a session id has been issued. I'm confused as to what user is being auto-authenticated and how i can disable that. I would expect to be required to authenticate via the login page that I've specified in the sites section of the sitecore web.config, but I'm not getting re-directed to the login page. Is there some anonymous access granted to a default user that I need to disable?
By default the extranet\anonymous user is used. If you do not want anonymous access you should break the inheritance for that user, probably on your home item.
Do make sure that your login page is accessible for that user though, otherwise nobody can login..

DRUPAL You are not authorized to access this page after clearing cookies

I was logged as a siteadmin on my local page, after clearing cookies I cannot login again on this same login and password. I tried to upload the backup of the database when i can login, but it not helped, i clear all the cache.
Did someone had a such problem? How to resolve it?
Thanks,
Vergili
try like this:
Go in PhpAdmin and select the database of your drupal website
Scroll down and Go to record users, admin user is always the first user id:1
Make EDIT the first user (admin user) and change field email with your email.
After email changed, go to your website and try to do "forgot password" on your loggin page, you will receive a email restore password in your email inserted in your database.
This can be a way to login again like admin.
If you have Drush installed you can navigate to your sites root directory in the console and type drush uli It will give you a one time login.
it will look like:
http://default/user/reset/1/1464702672/4-mLpgYQqVblYxY3xPq4hY6yF9K1vCvsvfOHgGNyhWg/login
Replace 'default' with your domain.

Django / Mezzanine: Staff users can't log in to admin

Using Django 1.8 and Mezzanine 4.0 and Python 3, if I assign a user as staff, I find they don't have permission to log into the admin pages of my site. They can if I assign them as superuser (which I don't want to do). My ALLOWED_HOSTS is set up properly and the same domain appears in the "Site permissions" list for the users.
I've searched online for others who have experienced this but the only thread I found was someone who found that the problem mysteriously resolved itself when they reinstalled their entire stack (which I don't want to do either!)
Can anyone shed any light?
If you open up the settings for the user you can select the site that you want it to have access to. Check out this for further information: How to set the permissions for admins of Django/Mezzanine sites

Sitecore requires me to login in order to see my website

When I access my site that's being managed by Sitecore, it's redirecting me and asking for Sitecore credentials. I have no idea why but obviously the main site should be viewable to public without needing creds.
Thanks.
This could be from your sitecore cookie still in page editor mode, To fix this add this query string to your URL:
?sc_mode=normal
This will update your cookie and no reddirect to login anymore
Assuming that you have a combined CM/CD environment and that this is specific to your computer or other authors' computers, it is likely that Sitecore is picking up on the fact that you were using the Page Editor in a previous session. When you are using Page Editor Sitecore will drop a cookie called website#sc_mode and set it to "edit". If you return to the page with that cookie set it will push you to the Login Page as it things you are attempting to edit that page.
To resolve this try clearing your cookies or using a browser in Incognito mode/Private Browsing.
If this is happening to other users I would suggest following Martijn's advice in the other Answer and checking your site definition.
Check your site definitions in the web.config and/or the sites.config in the /app_config/include/ folder. Most of the times there is some misconfiguration there.
Check the security roles set on your site pages. If for some reason access has been denied to the 'extranet/anonymous' user you won't be able to browse without being authenticated.

Django admin/frontend authentication issue

I am developing an application using Django 1.4. When I log into admin site in another tab in the browser, the application interface in which I am already logged in automatically logs out. Please help me in solving this issue. The browser I am using is Firefox. Thanks in advance.
Admin is also a user in django. So, you can't have more than one user logged in at the same time in the same browser, can you? Try the same scenario on facebook. This is what it is. You re fine, there's no problem.
On the side note, if you are just getting started with your project use Django 1.5.
Well you cannot log into the same website with different login ids simultaneously until and unless you dont use some plugins for this feature or you are opening different ids in the incognito window.
Since admin is a superuser(still a user), hence you cannot open a multiple django accounts in the same browser. One account will be logged out in order to open the other one. This is no issue. Happy coding.
The Django admin site is just another page of your Django main website. Say if you have foo.com, then foo.com/admin/ shows you the admin portal.
And we already know that two users cannot be simultaneously logged in to the same website from the same browser.
So, you can test on your foo.com site, being an admin user itself. Experience on the Django website for any user will be same, it doesn't change with user being a staff member or superuser. Only admin site has different permissions based on these factors.
In this case, you'll be able to use both the main site, as well as admin portal.
But if you really want to use different user accounts for admin site and main site, then you should either use different browsers or Private window in Firefox.