MCPcopy
hub / github.com/authts/oidc-client-ts / signinResourceOwnerCredentials

Method signinResourceOwnerCredentials

src/UserManager.ts:224–246  ·  view source on GitHub ↗

* Trigger the signin with user/password. * * @returns A promise containing the authenticated `User`. * @throws ErrorResponse In cases of wrong authentication.

({
        username,
        password,
        skipUserInfo = false,
    }: SigninResourceOwnerCredentialsArgs)

Source from the content-addressed store, hash-verified

222 * @throws {@link ErrorResponse} In cases of wrong authentication.
223 */
224 public async signinResourceOwnerCredentials({
225 username,
226 password,
227 skipUserInfo = false,
228 }: SigninResourceOwnerCredentialsArgs): Promise<User> {
229 const logger = this._logger.create("signinResourceOwnerCredential");
230
231 const signinResponse = await this._client.processResourceOwnerPasswordCredentials({
232 username,
233 password,
234 skipUserInfo,
235 extraTokenParams: this.settings.extraTokenParams,
236 });
237 logger.debug("got signin response");
238
239 const user = await this._buildUser(signinResponse);
240 if (user.profile && user.profile.sub) {
241 logger.info("success, signed in subject", user.profile.sub);
242 } else {
243 logger.info("no subject");
244 }
245 return user;
246 }
247
248 /**
249 * Trigger a request (via a popup window) to the authorization endpoint.

Callers 1

Calls 5

_buildUserMethod · 0.95
debugMethod · 0.65
infoMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected