![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Provides additional authentication options for @pnp/pnpjs (aka PnPjs) library
pnp-auth
adds additional authentication options for PnPjs library via implementing custom NodeFetchClient!Important: as library implements NodeFetchClient
and depends on node-sp-auth
module, you can use pnp-auth
only in nodejs environment
pnp-auth
uses node-sp-auth
as authentication library, thus making all authentication options from node-sp-auth
available for pnp-auth
.
Supported versions:
For full list of authentication options check out node-sp-auth
readme.
If you need support for the previous version of PnPjs, simply install the version of pnp-auth, which supports PnPjs v1:
npm install pnp-auth@0.x
Install @pnp/sp
libraries (they are listed as peer dependencies for pnp-auth
, that's why you should install them separately).
We need more than just @pnp/sp
because it depends on some other @pnp/
packages:
npm install @pnp/logging @pnp/common @pnp/odata @pnp/sp --save
pnp-auth
npm install pnp-auth --save
Before using PnPjs library, you should make it aware of your authentication data. That should be performed at the start of your application. The code is fairly simple:
import { bootstrap } from 'pnp-auth';
import { sp } from '@pnp/sp-commonjs';
bootstrap(sp, authData, siteUrl);
// That's it! Now you can use pnp-sp library:
sp.web.get().then(...);
OR with factory methods:
import { bootstrap } from 'pnp-auth';
import { sp, Web } from '@pnp/sp-commonjs';
bootstrap(sp, authData);
// That's it! Now you can use pnp-sp library:
let web = Web(siteUrl);
web.get().then(...)
sp
- "sp" object obtained from @pnp/sp-commonjs
library via import: import { sp } from '@pnp/sp-commonjs';
authData
- can be a string
, AuthConfig
object or raw node-sp-auth
credentials:
string
- absolute or relative path to your file with authentication data. File should be generated using node-sp-auth-config
CLI. When string is provided, pnp-auth
internally creates AuthConfig
with below default parameters:let authConfig = new AuthConfig({
configPath: <your path to file>,
encryptPassword: true,
saveConfigOnDisk: true
});
AuthConfig
- you can provide AuthConfig
directly. To learn more checkout node-sp-auth-config
repositorynode-sp-auth
. For more information checkout node-sp-auth
repository as well as wikisiteUrl
- your SharePoint site url. You have two options when working with SharePoint data. When using siteUrl
parameter, you can write a code sp.web.get()
etc., in that case your sp.web
object will be attached to your siteUrl
. If you want to work with different webs, you can use factory method: Web(<url to SharePoint>)
Of course, you can do bootstrap manually, if you want. pnp-auth
exports NodeFetchClient
which you can use in pnp's setup
method:
import NodeFetchClient from 'pnp-auth';
import { sp } from '@pnp/sp-commonjs';
sp.setup({
sp: {
fetchClientFactory: () => {
return new NodeFetchClient(authData, siteUrl);
}
}
});
npm install
npm run build
- tslint & TS compileLibrary has a few integration tests:
npm install
settings.sample.ts
to settings.ts
. Update webTitle
and subsiteUrl
to your real data.node-sp-auth-config
to generate credentials inside ./config/private.json
file. Site url in credentials should point to site with webTitle
from step #2
.npm test
FAQs
Provides additional authentication options for @pnp/pnpjs (aka PnPjs) library
The npm package pnp-auth receives a total of 282 weekly downloads. As such, pnp-auth popularity was classified as not popular.
We found that pnp-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.