
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
@arv-bedrock/auth-sso
Advanced tools
`@arv-bedrock/auth-sso` is a JavaScript/TypeScript library designed to provide an easy-to-use interface for managing user authentication and account-related functionalities. This library integrates seamlessly with the Bedrock authentication system to stre
@arv-bedrock/auth-sso
is a JavaScript/TypeScript library designed to provide an easy-to-use interface for managing user authentication and account-related functionalities. This library integrates seamlessly with the Bedrock authentication system to streamline your app's security needs.
Install the library via npm:
npm install @arv-bedrock/auth-sso
import * as BedrockAuth from "@arv-bedrock/auth-sso";
To initialize the authentication system, provide your credentials and configuration options:
import { initBedrockAuth } from "@arv-bedrock/auth-sso";
initBedrockAuth({
authUri: "https://auth.example.com",
clientId: "your-client-id",
clientSecret: "your-client-secret",
userType: "officer", // Optional: officer (default) / citizen
callback: (errorOrData) => {
if (errorOrData instanceof Error) {
console.error("Initialization error:", errorOrData);
} else {
console.log("Initialization successful:", errorOrData);
}
},
});
doLogin(redirectUrl?: string): void
Redirects the user to the login page.
BedrockAuth.doLogin("https://your-app.com/dashboard");
doLogout(redirectUrl?: string): Promise<void>
Logs the user out and optionally redirects them to the specified URL.
BedrockAuth.doLogout("https://your-app.com");
doRegister(redirectUrl?: string): void
Redirects the user to the registration page.
BedrockAuth.doRegister("https://your-app.com/welcome");
verifyToken(): Promise<ResponseData<[]>>
Verifies the validity of the user's token.
const response = await BedrockAuth.verifyToken();
console.log("Response:", response);
getProfile(): Promise<ResponseData<AuthServiceResponse> | undefined>
Fetches the current user's profile.
const profile = await BedrockAuth.getProfile();
console.log("User profile:", profile);
updateProfile(body: UpdateProfile): Promise<ResponseData<[]>>
Updates the user's profile.
const response = await BedrockAuth.updateProfile({ firstName: "First Name", lastName: "Last Name" title: "Mr.", userId: "User Id" });
console.log("Profile updated.", response);
doManageAccount(redirectUrl?: string): void
Redirects the user to the account management page.
BedrockAuth.doManageAccount("https://your-app.com/manage-account");
disabledAccount(body: DisabledAccount): Promise<ResponseData<[]>>
Disables a user account.
await BedrockAuth.disabledAccount({ userId: "12345", isDisabled: true });
console.log("Account disabled.");
setCookie(code: string): Promise<void>
Sets an authentication cookie.
await BedrockAuth.setCookie("auth-code");
clearCookie(): Promise<void>
Clears the authentication cookie.
await BedrockAuth.clearCookie();
refreshToken(): Promise<ResponseData<RefreshTokenResponse>>
Refreshes the authentication token.
const newToken = await BedrockAuth.refreshToken();
console.log("New token:", newToken);
getCode(): Promise<string>
Retrieves the authentication code.
const code = await BedrockAuth.getCode();
console.log("Auth code:", code);
requestInviting(email: string, duration?: number): Promise<ResponseData<[]>>
Sends an invitation email.
await BedrockAuth.requestInviting("user@example.com", 7);
console.log("Invitation sent.");
importUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>
Import users for preregistration
const importUser = await BedrockAuth.importUsers([{
title: "title";
email: "email";
firstName: "firstName";
lastName: "lastName";
phoneNumber: "phoneNumber";
}]);
console.log("ImportUsers", importUser);
updateImportUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>
Update the previously existing and unexpired imported records via email
const updateImportUser = await BedrockAuth.updateImportUsers([{
title: "title";
email: "email";
firstName: "firstName";
lastName: "lastName";
phoneNumber: "phoneNumber";
}]);
console.log("updateImportUser", updateImportUser);
deleteImportUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>
Delete the previously existing and unexpired imported records via email
const deleteImportUser = await BedrockAuth.deleteImportUsers(["example@gmail.com", "email@gmail.com"]);
console.log("deleteImportUser", deleteImportUser);
doPortal(): void
Redirects the user to the authentication portal.
BedrockAuth.doPortal();
getRedirectUri(): string
Retrieves the current redirect URI.
const redirectUri = BedrockAuth.getRedirectUri();
console.log("Redirect URI:", redirectUri);
AuthProps
Defines the properties required to initialize Bedrock Auth.
export type AuthProps = {
userType?: UserType; // "citizen" | "officer" (default: "officer")
authUri: string;
clientId: string;
clientSecret: string;
callback: (error?: any) => void;
};
DisabledAccount
Represents the details needed to disable an account.
export type DisabledAccount = {
userId: string;
isDisabled: boolean;
};
UpdateProfile
Defines the structure for updating user profile information.
export type UpdateProfile = {
userId: string;
title: string;
firstName: string;
lastName: string;
picture?: string | undefined | null;
};
ImportUserType
Represents the input data required to import a single user into the system.
export type ImportUserType {
title?: string;
email: string;
firstName?: string;
lastName?: string;
phoneNumber?: string;
}
ImportUserResponse
The response structure returned after processing a batch import of users. Contains a correlation ID for tracking and a list of per-user results.
export type ImportUserResponse {
correlationId: string;
results: ImportUserResult[];
}
ImportUserResult
Detailed result of an individual user import operation, including whether it succeeded and any failure reasons.
export type ImportUserResult {
i: number;
email: string;
success: boolean;
reasons: string[];
code?: string;
title?: string;
firstName?: string;
lastName?: string;
phoneNumber?: string;
expireAt?: string;
}
FAQs
`@arv-bedrock/auth-sso` is a JavaScript/TypeScript library designed to provide an easy-to-use interface for managing user authentication and account-related functionalities. This library integrates seamlessly with the Bedrock authentication system to stre
The npm package @arv-bedrock/auth-sso receives a total of 266 weekly downloads. As such, @arv-bedrock/auth-sso popularity was classified as not popular.
We found that @arv-bedrock/auth-sso demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.