How to use @solid/oidc-rp - 6 common examples

To help you get started, we’ve selected a few @solid/oidc-rp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github solid / solid-cli / src / SolidClient.js View on Github external
async getRelyingParty(identityProvider) {
    // Try to load an existing relying party
    let relyingParty;
    const providerSettings = this._identityManager.getProviderSettings(identityProvider);
    if (providerSettings) {
      relyingParty = RelyingParty.from(providerSettings);
    }
    // Create a new relying party
    else {
      relyingParty = await this.registerRelyingParty(identityProvider);
      this._identityManager.addProviderSettings(relyingParty);
    }
    return relyingParty;
  }
github solid / solid-auth-client / src / webid-oidc.js View on Github external
async function getStoredRp(storage: AsyncStorage): Promise {
  const data = await getData(storage)
  const { rpConfig } = data
  if (rpConfig) {
    rpConfig.store = storage
    return RelyingParty.from(rpConfig)
  } else {
    return null
  }
}
github solid / solid-auth-client / src / webid-oidc.js View on Github external
issuer: idp,
    grant_types: ['implicit'],
    redirect_uris: [callbackUri],
    response_types: [responseType],
    scope: 'openid profile'
  }
  const options = {
    defaults: {
      authenticate: {
        redirect_uri: callbackUri,
        response_type: responseType
      }
    },
    store: storage
  }
  return RelyingParty.register(idp, registration, options)
}
github solid / solid-cli / src / SolidClient.js View on Github external
const registration = {
      issuer: identityProvider,
      grant_types: ['implicit'],
      redirect_uris: [redirectUrl],
      response_types: [responseType],
      scope: 'openid profile',
    };
    const options = {
      defaults: {
        authenticate: {
          redirect_uri: redirectUrl,
          response_type: responseType,
        },
      },
    };
    return RelyingParty.register(identityProvider, registration, options);
  }
github solid / solid-auth-client / src / webid-oidc.js View on Github external
export async function fetchWithCredentials(
  session: webIdOidcSession,
  fetch: Function,
  input: RequestInfo,
  options?: RequestOptions
): Promise {
  const popToken = await PoPToken.issueFor(toUrlString(input), session)
  const authenticatedOptions = {
    ...options,
    credentials: 'include',
    headers: copyHeaders(
      {
        authorization: `Bearer ${popToken}`
      },
      options
    )
  }
  return fetch(input, authenticatedOptions)
}
github solid / solid-cli / src / SolidClient.js View on Github external
async createToken(url, session) {
    return PoPToken.issueFor(url, session);
  }

@solid/oidc-rp

OpenID Connect Relying Party client library

MIT
Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis

Similar packages