Pnpjs: Please support 21Vianet in package @pnp/nodejs

Created on 29 Jun 2018  路  4Comments  路  Source: pnp/pnpjs

Hi,

Please support 21Vianet auth in nodejs runtime.

Category

  • [x] Enhancement
  • [ ] Bug
  • [ ] Question
  • [ ] Documentation gap/issue

Version

1.1.1

Expected / Desired Behavior / Question

The following code is your current version, but just support office 365 international. In China, we use 21Vianet version, the auth url is ''https://accounts.accesscontrol.chinacloudapi.cn", please support it, thanks.

    private getAuthUrl(realm: string): Promise<string> {

        const url = `https://accounts.accesscontrol.windows.net/metadata/json/1?realm=${realm}`;

        return nodeFetch(url).then((r: Response) => r.json()).then((json: { endpoints: { protocol: string, location: string }[] }) => {

            const eps = json.endpoints.filter(ep => ep.protocol === "OAuth2");
            if (eps.length > 0) {
                return eps[0].location;
            }

            throw new AuthUrlException(json);
        });
    }

Observed Behavior

Steps to Reproduce

code complete enhancement

Most helpful comment

Just added this to dev branch, will be part of today's beta so you can try it out.

All 4 comments

Hi @iiunknown,

Thanks for your message. We should add German cloud support as well.

While there is no native support in @pnp/nodejs for China cloud as a workaround you can use sp-pnp-node fetch client or similar based on node-sp-auth. I know it supports these options.

This is a great idea, thanks.

@koltyakov @patrick-rodgers Thanks you all great work.

Just added this to dev branch, will be part of today's beta so you can try it out.

Was this page helpful?
0 / 5 - 0 ratings