Accessing content in a headless manner
See original GitHub issue- Added the package
Piranha.WebApi
- added
options.UseApi();
- I created a page called
home
with the same slug - Using PostMan REST Client, accessing
https://localhost:44305/api/page/GetBySlug?slug=home
(might be issue here) - Getting 401 error
Unauthorized
- I tried sending Basic Authentication with it using
admin/pass
, still same issue
I have the /manager accessible by admin/password
so I assume that is what is needed to be sent, the default identity is IdentitySqlLiteDb
if it matters.
I looked at the code for the .WebApi package and it seems to fail at the following.
[HttpGet]
[Route("{slug}")]
public async Task<IActionResult> GetBySlug(string slug)
{
if (!Module.AllowAnonymousAccess)
{
if (!(await _auth.AuthorizeAsync(User, Permissions.Pages)).Succeeded)
{
return Unauthorized();
}
}
return Json(await _api.Pages.GetBySlugAsync<PageBase>(slug));
}
How do I configure this specific module so that Anonymous
access is allowed and not even ask/require credentials?
I am simply trying to have a cms where I can enter content through /manager and then be able to access all created pages using the api (hopefully) without even any type of authentication.
I understand I can role my own API and remove the checks where it asks for creds but I would like to understand the process better and even prefer to use the built in provided by you guys.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Headless CMS 101: The Only Guide You'll Ever Need
The content stored in the headless CMS is accessed via a set of APIs that developers can use to present the data wherever...
Read more >A headless content management system (CMS) is ...
A headless CMS means that the content layer is decoupled or disconnected from the presentation layer. The content layer is where all the...
Read more >What is a Headless CMS?
Simply put, a headless CMS is a content management system that manages and organizes content without a connected front-end or display layer. The...
Read more >Everything You Need to Know About Headless CMS
With headless CMS, content can be easily reused across multiple channels, including websites, mobile apps, digital kiosks, and smart devices.
Read more >Losing our Heads for Better Content Management
A “headless” or “decoupled” CMS is a Content Management System that focuses solely on a content authoring, curation, and publishing workflow.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The correct syntax for calling that endpoint would be
See this to: https://gist.github.com/biapar/e48bb57e86759c9ffb14fdabbf804369