Comments (11)
We will provide a tutorial for you
from piranha.core.docs.
Please take a look at this tutorial and let us know if it makes sense or should be improved in any way!
Source code:
https://github.com/PiranhaCMS/piranha.core.docs/blob/master/src/08.%20Tutorials/01.%20Securing%20Pages.md
Webpage:
http://piranhacms.org/docs/tutorials/securing-pages
Regards
from piranha.core.docs.
I think I missed out one thing for MVC. This baseclass when using Razor Pages catches the exception thrown by model loader and returns unauthorized:
You need to add the same behavior by yourself in your controller actions in CmsController, otherwise you will just get an exception and not a 401.
Regards
from piranha.core.docs.
No. The minimum requirements for logging into the admin interface is that the user is an admin. It hasn’t been designed with that use case in mind.
from piranha.core.docs.
Thank you for the quick reply. Do you have any instructions on how to use the admin to go to authorized pages? Or how to do best practice of authorized pages?
from piranha.core.docs.
I think we will have to do a tutorial on it, but in short, here are my suggestions:
- Add
AuthorizeAttribute
on manager pages. - Do not add
AuthorizeAttribute
on public pages, instead select the claims the user should have on the page instance. - For public pages, get them using the
IModelLoader
, like in the template projects. The loader will perform security checks for the current user and the requested page. - If the user doesn't have access, the
IModelLoader
will throw aUnathorizedException
, customize the middleware pipeline to redirect users when this happen to a public login page, not the login page of the manager.
Best regards
from piranha.core.docs.
I don't understand you here
from piranha.core.docs.
I moved this issue to the docs repo as well
from piranha.core.docs.
Hi.
Thank you so much.
I made this repo, https://github.com/traustitj/piranhalogin.git
Not Sure what I am doing wrong here.
from piranha.core.docs.
Ahh, thank you. You really helped me a great deal.
from piranha.core.docs.
Works like a charm.
from piranha.core.docs.
Related Issues (20)
- CMSController.cs is missing HOT 2
- How do we create a custom archive with custom posts
- The lack of any serious auth documentation has become an issue.
- Add "author" to archive posts HOT 1
- Complete example of creating a new pagetype/archivetype HOT 1
- Documentation for custom data layer HOT 2
- Creating Module but HeaderBlock does not exist.
- Where can I set up Chinese? HOT 1
- SimpleModule not found
- Docs error HOT 1
- Exception on custom Login request HOT 1
- Using a custom vue file
- Add navigation buttons to docs pages HOT 4
- Renaming content type route 404 error HOT 2
- Running multiple sites with Nginx proxy pass HOT 1
- Calling/api/page/{slug} Getting 500 Error HOT 2
- Remove references to PageTypeRouteAttribute HOT 4
- Improve docs for mixed mode applications HOT 3
- Antiforgery cookie when using external identity provider
- Where would I find the actual API reference ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piranha.core.docs.