Skip to content

Embedded markdown fails due to cross site authenticaiton  #1422

Open
@cmbaatz

Description

@cmbaatz

Bug Report

Steps to reproduce

Exposing this issue requires the import of a markdown behind an authenticated site. The bug was discovered when working on a site locally using the docsify-cli tool in which a markdown page had embedded another markdown from a corporate github enterprise system. It's assumed that once the pages were uploaded to the same github instance the issue would be resolved, but this bug makes it impossible to work on such documentation on a local environment.

  1. Create a markdown for embedding and store it into a github instance, which when served by pages will require authentication.
  2. Create a new github pages project using the docsify embed feature attempt to embed the remote page.
  3. Serve the new github pages project locally using the docsify-cli tool

What is current behaviour

When docsify attempts to fetch the protected resource instead of the markdown the request is redirected to the authentication page, which is returned and embedded into the markdown.

What is the expected behaviour

When embedding a protected markdown that I have already authenticated to I should see the contents of that markdown embedded into the page.

Other relevant information

To solve this issue the XMLHttpRequest used to fetch the contents should set the withCredentials value to true. If the use has then successfully authenticated in the browser to the protected resource this would allow docsify to properly fetch the requested content.

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: RHEL v8.0.2

  • Node.js version: v10.21.0

  • npm/yarn version: 6.14.4

  • Browser version: Firefox 81.0.2, Chrome 86.0.4240.183

  • Docsify version: 4.11.6

  • Docsify plugins:

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions