Skip to content

A component to create an <iframe> with a URL that demands authentication in the headers

Notifications You must be signed in to change notification settings

enriquemorenotent/react-auth-iframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React authenticated iframe

React authenticated iframe is a component that can be used if you want to create an iframe, but the resource to be fetched requires token authentication.

Usage

This is an example to open an <iframe> with a PDF file behind an authenticated API.

import AuthIFrame from "react-auth-iframe";

const MyComponent = () => <div>
    <AuthIFrame
        src="https://api.my-domain.com/files/document.pdf"
        token={token}
        type="application/pdf" />
</div>

About

A component to create an <iframe> with a URL that demands authentication in the headers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published