client

package
v0.0.0-...-c4e146e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func URIWithSegment

func URIWithSegment(uri, segment string) string

URIWithSegment returns a string with a "/" delimiter between the uri and segment

Types

type FusionAuthClient

type FusionAuthClient struct {
	BaseURL    *url.URL
	APIKey     string
	HTTPClient *http.Client
}

FusionAuthClient describes the Go Client for interacting with FusionAuth's RESTful API

func (*FusionAuthClient) ActionUser

func (c *FusionAuthClient) ActionUser(actioneeUserId string, request interface{}) (interface{}, error)

ActionUser Takes an action on a user. The user being actioned is called the "actionee" and the user taking the action is called the "actioner". Both user ids are required. You pass the actionee's user id into the method and the actioner's is put into the request object.

string actioneeUserId The actionee's user id.
interface{} request The action request that includes all of the information about the action being taken including
the id of the action, any options and the duration (if applicable).

func (*FusionAuthClient) CancelAction

func (c *FusionAuthClient) CancelAction(actionId string, request interface{}) (interface{}, error)

CancelAction Cancels the user action.

string actionId The action id of the action to cancel.
interface{} request The action request that contains the information about the cancellation.

func (*FusionAuthClient) ChangePassword

func (c *FusionAuthClient) ChangePassword(changePasswordId string, request interface{}) (interface{}, error)

ChangePassword Changes a user's password using the change password Id. This usually occurs after an email has been sent to the user and they clicked on a link to reset their password.

string changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
interface{} request The change password request that contains all of the information used to change the password.

func (*FusionAuthClient) ChangePasswordByIdentity

func (c *FusionAuthClient) ChangePasswordByIdentity(request interface{}) (interface{}, error)

ChangePasswordByIdentity Changes a user's password using their identity (login id and password). Using a loginId instead of the changePasswordId bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword method.

interface{} request The change password request that contains all of the information used to change the password.

func (*FusionAuthClient) CommentOnUser

func (c *FusionAuthClient) CommentOnUser(request interface{}) (interface{}, error)

CommentOnUser Adds a comment to the user's account.

interface{} request The request object that contains all of the information used to create the user comment.

func (*FusionAuthClient) CreateApplication

func (c *FusionAuthClient) CreateApplication(applicationId string, request interface{}) (interface{}, error)

CreateApplication Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.

string applicationId (Optional) The Id to use for the application. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the application.

func (*FusionAuthClient) CreateApplicationRole

func (c *FusionAuthClient) CreateApplicationRole(applicationId string, roleId string, request interface{}) (interface{}, error)

CreateApplicationRole Creates a new role for an application. You must specify the id of the application you are creating the role for. You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.

string applicationId The Id of the application to create the role on.
string roleId (Optional) The Id of the role. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the application role.

func (*FusionAuthClient) CreateAuditLog

func (c *FusionAuthClient) CreateAuditLog(request interface{}) (interface{}, error)

CreateAuditLog Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.

interface{} request The request object that contains all of the information used to create the audit log entry.

func (*FusionAuthClient) CreateEmailTemplate

func (c *FusionAuthClient) CreateEmailTemplate(emailTemplateId string, request interface{}) (interface{}, error)

CreateEmailTemplate Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.

string emailTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the email template.

func (*FusionAuthClient) CreateGroup

func (c *FusionAuthClient) CreateGroup(groupId string, request interface{}) (interface{}, error)

CreateGroup Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.

string groupId (Optional) The Id for the group. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the group.

func (*FusionAuthClient) CreateGroupMembers

func (c *FusionAuthClient) CreateGroupMembers(request interface{}) (interface{}, error)

CreateGroupMembers Creates a member in a group.

interface{} request The request object that contains all of the information used to create the group member(s).

func (*FusionAuthClient) CreateIdentityProvider

func (c *FusionAuthClient) CreateIdentityProvider(identityProviderId string, request interface{}) (interface{}, error)

CreateIdentityProvider Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.

string identityProviderId (Optional) The Id of the identity provider. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the identity provider.

func (*FusionAuthClient) CreateLambda

func (c *FusionAuthClient) CreateLambda(lambdaId string, request interface{}) (interface{}, error)

CreateLambda Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.

string lambdaId (Optional) The Id for the lambda. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the lambda.

func (*FusionAuthClient) CreateTenant

func (c *FusionAuthClient) CreateTenant(tenantId string, request interface{}) (interface{}, error)

CreateTenant Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.

string tenantId (Optional) The Id for the tenant. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the tenant.

func (*FusionAuthClient) CreateUser

func (c *FusionAuthClient) CreateUser(userId string, request interface{}) (interface{}, error)

CreateUser Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.

string userId (Optional) The Id for the user. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the user.

func (*FusionAuthClient) CreateUserAction

func (c *FusionAuthClient) CreateUserAction(userActionId string, request interface{}) (interface{}, error)

CreateUserAction Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after that the user action can be applied to any user.

string userActionId (Optional) The Id for the user action. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the user action.

func (*FusionAuthClient) CreateUserActionReason

func (c *FusionAuthClient) CreateUserActionReason(userActionReasonId string, request interface{}) (interface{}, error)

CreateUserActionReason Creates a user reason. This user action reason cannot be used when actioning a user until this call completes successfully. Anytime after that the user action reason can be used.

string userActionReasonId (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the user action reason.

func (*FusionAuthClient) CreateWebhook

func (c *FusionAuthClient) CreateWebhook(webhookId string, request interface{}) (interface{}, error)

CreateWebhook Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.

string webhookId (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.
interface{} request The request object that contains all of the information used to create the webhook.

func (*FusionAuthClient) DeactivateApplication

func (c *FusionAuthClient) DeactivateApplication(applicationId string) (interface{}, error)

DeactivateApplication Deactivates the application with the given Id.

string applicationId The Id of the application to deactivate.

func (*FusionAuthClient) DeactivateUser

func (c *FusionAuthClient) DeactivateUser(userId string) (interface{}, error)

DeactivateUser Deactivates the user with the given Id.

string userId The Id of the user to deactivate.

func (*FusionAuthClient) DeactivateUserAction

func (c *FusionAuthClient) DeactivateUserAction(userActionId string) (interface{}, error)

DeactivateUserAction Deactivates the user action with the given Id.

string userActionId The Id of the user action to deactivate.

func (*FusionAuthClient) DeactivateUsers

func (c *FusionAuthClient) DeactivateUsers(userIds []string) (interface{}, error)

DeactivateUsers Deactivates the users with the given ids.

[]string userIds The ids of the users to deactivate.

func (*FusionAuthClient) DeleteApplication

func (c *FusionAuthClient) DeleteApplication(applicationId string) (interface{}, error)

DeleteApplication Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will delete the application, any registrations for that application, metrics and reports for the application, all the roles for the application, and any other data associated with the application. This operation could take a very long time, depending on the amount of data in your database.

string applicationId The Id of the application to delete.

func (*FusionAuthClient) DeleteApplicationRole

func (c *FusionAuthClient) DeleteApplicationRole(applicationId string, roleId string) (interface{}, error)

DeleteApplicationRole Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given role from all users that had it.

string applicationId The Id of the application to deactivate.
string roleId The Id of the role to delete.

func (*FusionAuthClient) DeleteEmailTemplate

func (c *FusionAuthClient) DeleteEmailTemplate(emailTemplateId string) (interface{}, error)

DeleteEmailTemplate Deletes the email template for the given Id.

string emailTemplateId The Id of the email template to delete.

func (*FusionAuthClient) DeleteGroup

func (c *FusionAuthClient) DeleteGroup(groupId string) (interface{}, error)

DeleteGroup Deletes the group for the given Id.

string groupId The Id of the group to delete.

func (*FusionAuthClient) DeleteGroupMembers

func (c *FusionAuthClient) DeleteGroupMembers(request interface{}) (interface{}, error)

DeleteGroupMembers Removes users as members of a group.

interface{} request The member request that contains all of the information used to remove members to the group.

func (*FusionAuthClient) DeleteIdentityProvider

func (c *FusionAuthClient) DeleteIdentityProvider(identityProviderId string) (interface{}, error)

DeleteIdentityProvider Deletes the identity provider for the given Id.

string identityProviderId The Id of the identity provider to delete.

func (*FusionAuthClient) DeleteLambda

func (c *FusionAuthClient) DeleteLambda(lambdaId string) (interface{}, error)

DeleteLambda Deletes the lambda for the given Id.

string lambdaId The Id of the lambda to delete.

func (*FusionAuthClient) DeleteRegistration

func (c *FusionAuthClient) DeleteRegistration(userId string, applicationId string) (interface{}, error)

DeleteRegistration Deletes the user registration for the given user and application.

string userId The Id of the user whose registration is being deleted.
string applicationId The Id of the application to remove the registration for.

func (*FusionAuthClient) DeleteTenant

func (c *FusionAuthClient) DeleteTenant(tenantId string) (interface{}, error)

DeleteTenant Deletes the tenant for the given Id.

string tenantId The Id of the tenant to delete.

func (*FusionAuthClient) DeleteUser

func (c *FusionAuthClient) DeleteUser(userId string) (interface{}, error)

DeleteUser Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated with the user.

string userId The Id of the user to delete.

func (*FusionAuthClient) DeleteUserAction

func (c *FusionAuthClient) DeleteUserAction(userActionId string) (interface{}, error)

DeleteUserAction Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of the action being applied to any users.

string userActionId The Id of the user action to delete.

func (*FusionAuthClient) DeleteUserActionReason

func (c *FusionAuthClient) DeleteUserActionReason(userActionReasonId string) (interface{}, error)

DeleteUserActionReason Deletes the user action reason for the given Id.

string userActionReasonId The Id of the user action reason to delete.

func (*FusionAuthClient) DeleteUsers

func (c *FusionAuthClient) DeleteUsers(request interface{}) (interface{}, error)

DeleteUsers Deletes the users with the given ids.

interface{} request The ids of the users to delete.

func (*FusionAuthClient) DeleteWebhook

func (c *FusionAuthClient) DeleteWebhook(webhookId string) (interface{}, error)

DeleteWebhook Deletes the webhook for the given Id.

string webhookId The Id of the webhook to delete.

func (*FusionAuthClient) DisableTwoFactor

func (c *FusionAuthClient) DisableTwoFactor(userId string, code string) (interface{}, error)

DisableTwoFactor Disable Two Factor authentication for a user.

string userId The Id of the User for which you're disabling Two Factor authentication.
string code The Two Factor code used verify the the caller knows the Two Factor secret.

func (*FusionAuthClient) Do

func (c *FusionAuthClient) Do(req *http.Request, v interface{}) (*http.Response, error)

Do makes the request to the FusionAuth API endpoint and decodes the response

func (*FusionAuthClient) EnableTwoFactor

func (c *FusionAuthClient) EnableTwoFactor(userId string, request interface{}) (interface{}, error)

EnableTwoFactor Enable Two Factor authentication for a user.

string userId The Id of the user to enable Two Factor authentication.
interface{} request The two factor enable request information.

func (*FusionAuthClient) ExchangeOAuthCodeForAccessToken

func (c *FusionAuthClient) ExchangeOAuthCodeForAccessToken(code string, clientID string, clientSecret string, redirectURI string) (interface{}, error)

ExchangeOAuthCodeForAccessToken Exchanges an OAuth authorization code for an access token.

string code The OAuth authorization code.
string clientID The OAuth client_id.
string clientSecret (Optional: use "" to disregard this parameter) The OAuth client_secret used for Basic Auth.
string redirectURI The OAuth redirect_uri.

func (*FusionAuthClient) ExchangeRefreshTokenForJWT

func (c *FusionAuthClient) ExchangeRefreshTokenForJWT(request interface{}) (interface{}, error)

ExchangeRefreshTokenForJWT Exchange a refresh token for a new JWT.

interface{} request The refresh request.

func (*FusionAuthClient) ForgotPassword

func (c *FusionAuthClient) ForgotPassword(request interface{}) (interface{}, error)

ForgotPassword Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.

interface{} request The request that contains the information about the user so that they can be emailed.

func (*FusionAuthClient) GenerateEmailVerificationId

func (c *FusionAuthClient) GenerateEmailVerificationId(email string) (interface{}, error)

GenerateEmailVerificationId Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.

string email The email address of the user that needs a new verification email.

func (*FusionAuthClient) GenerateRegistrationVerificationId

func (c *FusionAuthClient) GenerateRegistrationVerificationId(email string, applicationId string) (interface{}, error)

GenerateRegistrationVerificationId Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.

string email The email address of the user that needs a new verification email.
string applicationId The Id of the application to be verified.

func (*FusionAuthClient) GenerateTwoFactorSecret

func (c *FusionAuthClient) GenerateTwoFactorSecret() (interface{}, error)

GenerateTwoFactorSecret Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.

func (*FusionAuthClient) GenerateTwoFactorSecretUsingJWT

func (c *FusionAuthClient) GenerateTwoFactorSecretUsingJWT(encodedJWT string) (interface{}, error)

GenerateTwoFactorSecretUsingJWT Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.

string encodedJWT The encoded JWT (access token).

func (*FusionAuthClient) IdentityProviderLogin

func (c *FusionAuthClient) IdentityProviderLogin(request interface{}) (interface{}, error)

IdentityProviderLogin Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.

interface{} request The third-party login request that contains information from the third-party login
providers that FusionAuth uses to reconcile the user's account.

func (*FusionAuthClient) ImportUsers

func (c *FusionAuthClient) ImportUsers(request interface{}) (interface{}, error)

ImportUsers Bulk imports multiple users. This does some validation, but then tries to run batch inserts of users. This reduces latency when inserting lots of users. Therefore, the error response might contain some information about failures, but it will likely be pretty generic.

interface{} request The request that contains all of the information about all of the users to import.

func (*FusionAuthClient) IssueJWT

func (c *FusionAuthClient) IssueJWT(applicationId string, encodedJWT string) (interface{}, error)

IssueJWT Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid access token is properly signed and not expired. <p> This API may be used in an SSO configuration to issue new tokens for another application after the user has obtained a valid token from authentication.

string applicationId The Application Id for which you are requesting a new access token be issued.
string encodedJWT The encoded JWT (access token).

func (*FusionAuthClient) Login

func (c *FusionAuthClient) Login(request interface{}) (interface{}, error)

Login Logs a user in.

interface{} request The login request that contains the user credentials used to log them in.

func (*FusionAuthClient) LoginPing

func (c *FusionAuthClient) LoginPing(userId string, applicationId string, callerIPAddress string) (interface{}, error)

LoginPing Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.

string userId The Id of the user that was logged in.
string applicationId The Id of the application that they logged into.
string callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided
the IP address will be that of the client or last proxy that sent the request.

func (*FusionAuthClient) Logout

func (c *FusionAuthClient) Logout(global bool, refreshToken string) (interface{}, error)

Logout The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API does nothing if the request does not contain an access token or refresh token cookies.

bool global When this value is set to true all of the refresh tokens issued to the owner of the
provided token will be revoked.
string refreshToken (Optional) The refresh_token as a request parameter instead of coming in via a cookie.
If provided this takes precedence over the cookie.

func (*FusionAuthClient) LookupIdentityProvider

func (c *FusionAuthClient) LookupIdentityProvider(domain string) (interface{}, error)

LookupIdentityProvider Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed by a registered identity provider. A 404 indicates the domain is not managed.

string domain The domain or email address to lookup.

func (*FusionAuthClient) ModifyAction

func (c *FusionAuthClient) ModifyAction(actionId string, request interface{}) (interface{}, error)

ModifyAction Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.

string actionId The Id of the action to modify. This is technically the user action log id.
interface{} request The request that contains all of the information about the modification.

func (*FusionAuthClient) NewRequest

func (c *FusionAuthClient) NewRequest(method, endpoint string, body interface{}) (*http.Request, error)

NewRequest creates a new request for the FusionAuth API call

func (*FusionAuthClient) PasswordlessLogin

func (c *FusionAuthClient) PasswordlessLogin(request interface{}) (interface{}, error)

PasswordlessLogin Complete a login request using a passwordless code

interface{} request The passwordless login request that contains all of the information used to complete login.

func (*FusionAuthClient) ReactivateApplication

func (c *FusionAuthClient) ReactivateApplication(applicationId string) (interface{}, error)

ReactivateApplication Reactivates the application with the given Id.

string applicationId The Id of the application to reactivate.

func (*FusionAuthClient) ReactivateUser

func (c *FusionAuthClient) ReactivateUser(userId string) (interface{}, error)

ReactivateUser Reactivates the user with the given Id.

string userId The Id of the user to reactivate.

func (*FusionAuthClient) ReactivateUserAction

func (c *FusionAuthClient) ReactivateUserAction(userActionId string) (interface{}, error)

ReactivateUserAction Reactivates the user action with the given Id.

string userActionId The Id of the user action to reactivate.

func (*FusionAuthClient) ReconcileJWT

func (c *FusionAuthClient) ReconcileJWT(request interface{}) (interface{}, error)

ReconcileJWT Reconcile a User to FusionAuth using JWT issued from another Identity Provider.

interface{} request The reconcile request that contains the data to reconcile the User.

func (*FusionAuthClient) Register

func (c *FusionAuthClient) Register(userId string, request interface{}) (interface{}, error)

Register Registers a user for an application. If you provide the User and the UserRegistration object on this request, it will create the user as well as register them for the application. This is called a Full Registration. However, if you only provide the UserRegistration object, then the user must already exist and they will be registered for the application. The user id can also be provided and it will either be used to look up an existing user or it will be used for the newly created User.

string userId (Optional) The Id of the user being registered for the application and optionally created.
interface{} request The request that optionally contains the User and must contain the UserRegistration.

func (*FusionAuthClient) ResendEmailVerification

func (c *FusionAuthClient) ResendEmailVerification(email string) (interface{}, error)

ResendEmailVerification Re-sends the verification email to the user.

string email The email address of the user that needs a new verification email.

func (*FusionAuthClient) ResendRegistrationVerification

func (c *FusionAuthClient) ResendRegistrationVerification(email string, applicationId string) (interface{}, error)

ResendRegistrationVerification Re-sends the application registration verification email to the user.

string email The email address of the user that needs a new verification email.
string applicationId The Id of the application to be verified.

func (*FusionAuthClient) RetrieveAction

func (c *FusionAuthClient) RetrieveAction(actionId string) (interface{}, error)

RetrieveAction Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.

string actionId The Id of the action to retrieve.

func (*FusionAuthClient) RetrieveActions

func (c *FusionAuthClient) RetrieveActions(userId string) (interface{}, error)

RetrieveActions Retrieves all of the actions for the user with the given Id. This will return all time based actions that are active, and inactive as well as non-time based actions.

string userId The Id of the user to fetch the actions for.

func (*FusionAuthClient) RetrieveActionsPreventingLogin

func (c *FusionAuthClient) RetrieveActionsPreventingLogin(userId string) (interface{}, error)

RetrieveActionsPreventingLogin Retrieves all of the actions for the user with the given Id that are currently preventing the User from logging in.

string userId The Id of the user to fetch the actions for.

func (*FusionAuthClient) RetrieveActiveActions

func (c *FusionAuthClient) RetrieveActiveActions(userId string) (interface{}, error)

RetrieveActiveActions Retrieves all of the actions for the user with the given Id that are currently active. An active action means one that is time based and has not been canceled, and has not ended.

string userId The Id of the user to fetch the actions for.

func (*FusionAuthClient) RetrieveApplication

func (c *FusionAuthClient) RetrieveApplication(applicationId string) (interface{}, error)

RetrieveApplication Retrieves the application for the given id or all of the applications if the id is null.

string applicationId (Optional) The application id.

func (*FusionAuthClient) RetrieveApplications

func (c *FusionAuthClient) RetrieveApplications() (interface{}, error)

RetrieveApplications Retrieves all of the applications.

func (*FusionAuthClient) RetrieveAuditLog

func (c *FusionAuthClient) RetrieveAuditLog(auditLogId int) (interface{}, error)

RetrieveAuditLog Retrieves a single audit log for the given Id.

int auditLogId The Id of the audit log to retrieve.

func (*FusionAuthClient) RetrieveDailyActiveReport

func (c *FusionAuthClient) RetrieveDailyActiveReport(applicationId string, start interface{}, end interface{}) (interface{}, error)

RetrieveDailyActiveReport Retrieves the daily active user report between the two instants. If you specify an application id, it will only return the daily active counts for that application.

string applicationId (Optional) The application id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveEmailTemplate

func (c *FusionAuthClient) RetrieveEmailTemplate(emailTemplateId string) (interface{}, error)

RetrieveEmailTemplate Retrieves the email template for the given Id. If you don't specify the id, this will return all of the email templates.

string emailTemplateId (Optional) The Id of the email template.

func (*FusionAuthClient) RetrieveEmailTemplatePreview

func (c *FusionAuthClient) RetrieveEmailTemplatePreview(request interface{}) (interface{}, error)

RetrieveEmailTemplatePreview Creates a preview of the email template provided in the request. This allows you to preview an email template that hasn't been saved to the database yet. The entire email template does not need to be provided on the request. This will create the preview based on whatever is given.

interface{} request The request that contains the email template and optionally a locale to render it in.

func (*FusionAuthClient) RetrieveEmailTemplates

func (c *FusionAuthClient) RetrieveEmailTemplates() (interface{}, error)

RetrieveEmailTemplates Retrieves all of the email templates.

func (*FusionAuthClient) RetrieveGroup

func (c *FusionAuthClient) RetrieveGroup(groupId string) (interface{}, error)

RetrieveGroup Retrieves the group for the given Id.

string groupId The Id of the group.

func (*FusionAuthClient) RetrieveGroups

func (c *FusionAuthClient) RetrieveGroups() (interface{}, error)

RetrieveGroups Retrieves all of the groups.

func (*FusionAuthClient) RetrieveIdentityProvider

func (c *FusionAuthClient) RetrieveIdentityProvider(identityProviderId string) (interface{}, error)

RetrieveIdentityProvider Retrieves the identity provider for the given id or all of the identity providers if the id is null.

string identityProviderId (Optional) The identity provider id.

func (*FusionAuthClient) RetrieveIdentityProviders

func (c *FusionAuthClient) RetrieveIdentityProviders() (interface{}, error)

RetrieveIdentityProviders Retrieves all of the identity providers.

func (*FusionAuthClient) RetrieveInactiveActions

func (c *FusionAuthClient) RetrieveInactiveActions(userId string) (interface{}, error)

RetrieveInactiveActions Retrieves all of the actions for the user with the given Id that are currently inactive. An inactive action means one that is time based and has been canceled or has expired, or is not time based.

string userId The Id of the user to fetch the actions for.

func (*FusionAuthClient) RetrieveInactiveApplications

func (c *FusionAuthClient) RetrieveInactiveApplications() (interface{}, error)

RetrieveInactiveApplications Retrieves all of the applications that are currently inactive.

func (*FusionAuthClient) RetrieveInactiveUserActions

func (c *FusionAuthClient) RetrieveInactiveUserActions() (interface{}, error)

RetrieveInactiveUserActions Retrieves all of the user actions that are currently inactive.

func (*FusionAuthClient) RetrieveIntegration

func (c *FusionAuthClient) RetrieveIntegration() (interface{}, error)

RetrieveIntegration Retrieves the available integrations.

func (*FusionAuthClient) RetrieveJWTPublicKey

func (c *FusionAuthClient) RetrieveJWTPublicKey(keyId string) (interface{}, error)

RetrieveJWTPublicKey Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id. If the key Id is provided a single public key will be returned if one is found by that id. If the optional parameter key Id is not provided all public keys will be returned.

string keyId (Optional) The Id of the public key.

func (*FusionAuthClient) RetrieveJWTPublicKeys

func (c *FusionAuthClient) RetrieveJWTPublicKeys() (interface{}, error)

RetrieveJWTPublicKeys Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).

func (*FusionAuthClient) RetrieveLambda

func (c *FusionAuthClient) RetrieveLambda(lambdaId string) (interface{}, error)

RetrieveLambda Retrieves the lambda for the given Id.

string lambdaId The Id of the lambda.

func (*FusionAuthClient) RetrieveLambdas

func (c *FusionAuthClient) RetrieveLambdas() (interface{}, error)

RetrieveLambdas Retrieves all of the lambdas.

func (*FusionAuthClient) RetrieveLoginReport

func (c *FusionAuthClient) RetrieveLoginReport(applicationId string, start interface{}, end interface{}) (interface{}, error)

RetrieveLoginReport Retrieves the login report between the two instants. If you specify an application id, it will only return the login counts for that application.

string applicationId (Optional) The application id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveMonthlyActiveReport

func (c *FusionAuthClient) RetrieveMonthlyActiveReport(applicationId string, start interface{}, end interface{}) (interface{}, error)

RetrieveMonthlyActiveReport Retrieves the monthly active user report between the two instants. If you specify an application id, it will only return the monthly active counts for that application.

string applicationId (Optional) The application id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveOauthConfiguration

func (c *FusionAuthClient) RetrieveOauthConfiguration(applicationId string) (interface{}, error)

RetrieveOauthConfiguration Retrieves the Oauth2 configuration for the application for the given Application Id.

string applicationId The Id of the Application to retrieve OAuth configuration.

func (*FusionAuthClient) RetrievePasswordValidationRules

func (c *FusionAuthClient) RetrievePasswordValidationRules() (interface{}, error)

RetrievePasswordValidationRules Retrieves the password validation rules.

func (*FusionAuthClient) RetrieveRecentLogins

func (c *FusionAuthClient) RetrieveRecentLogins(offset interface{}, limit int) (interface{}, error)

RetrieveRecentLogins Retrieves the last number of login records.

interface{} offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
int limit (Optional, defaults to 10) The number of records to retrieve.

func (*FusionAuthClient) RetrieveRefreshTokens

func (c *FusionAuthClient) RetrieveRefreshTokens(userId string) (interface{}, error)

RetrieveRefreshTokens Retrieves the refresh tokens that belong to the user with the given Id.

string userId The Id of the user.

func (*FusionAuthClient) RetrieveRegistration

func (c *FusionAuthClient) RetrieveRegistration(userId string, applicationId string) (interface{}, error)

RetrieveRegistration Retrieves the user registration for the user with the given id and the given application id.

string userId The Id of the user.
string applicationId The Id of the application.

func (*FusionAuthClient) RetrieveRegistrationReport

func (c *FusionAuthClient) RetrieveRegistrationReport(applicationId string, start interface{}, end interface{}) (interface{}, error)

RetrieveRegistrationReport Retrieves the registration report between the two instants. If you specify an application id, it will only return the registration counts for that application.

string applicationId (Optional) The application id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveSystemConfiguration

func (c *FusionAuthClient) RetrieveSystemConfiguration() (interface{}, error)

RetrieveSystemConfiguration Retrieves the system configuration.

func (*FusionAuthClient) RetrieveTenant

func (c *FusionAuthClient) RetrieveTenant(tenantId string) (interface{}, error)

RetrieveTenant Retrieves the tenant for the given Id.

string tenantId The Id of the tenant.

func (*FusionAuthClient) RetrieveTenants

func (c *FusionAuthClient) RetrieveTenants() (interface{}, error)

RetrieveTenants Retrieves all of the tenants.

func (*FusionAuthClient) RetrieveTotalReport

func (c *FusionAuthClient) RetrieveTotalReport() (interface{}, error)

RetrieveTotalReport Retrieves the totals report. This contains all of the total counts for each application and the global registration count.

func (*FusionAuthClient) RetrieveUser

func (c *FusionAuthClient) RetrieveUser(userId string) (interface{}, error)

RetrieveUser Retrieves the user for the given Id.

string userId The Id of the user.

func (*FusionAuthClient) RetrieveUserAction

func (c *FusionAuthClient) RetrieveUserAction(userActionId string) (interface{}, error)

RetrieveUserAction Retrieves the user action for the given Id. If you pass in null for the id, this will return all of the user actions.

string userActionId (Optional) The Id of the user action.

func (*FusionAuthClient) RetrieveUserActionReason

func (c *FusionAuthClient) RetrieveUserActionReason(userActionReasonId string) (interface{}, error)

RetrieveUserActionReason Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all of the user action reasons.

string userActionReasonId (Optional) The Id of the user action reason.

func (*FusionAuthClient) RetrieveUserActionReasons

func (c *FusionAuthClient) RetrieveUserActionReasons() (interface{}, error)

RetrieveUserActionReasons Retrieves all the user action reasons.

func (*FusionAuthClient) RetrieveUserActions

func (c *FusionAuthClient) RetrieveUserActions() (interface{}, error)

RetrieveUserActions Retrieves all of the user actions.

func (*FusionAuthClient) RetrieveUserByChangePasswordId

func (c *FusionAuthClient) RetrieveUserByChangePasswordId(changePasswordId string) (interface{}, error)

RetrieveUserByChangePasswordId Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user's email or username.

string changePasswordId The unique change password Id that was sent via email or returned by the Forgot Password API.

func (*FusionAuthClient) RetrieveUserByEmail

func (c *FusionAuthClient) RetrieveUserByEmail(email string) (interface{}, error)

RetrieveUserByEmail Retrieves the user for the given email.

string email The email of the user.

func (*FusionAuthClient) RetrieveUserByLoginId

func (c *FusionAuthClient) RetrieveUserByLoginId(loginId string) (interface{}, error)

RetrieveUserByLoginId Retrieves the user for the loginId. The loginId can be either the username or the email.

string loginId The email or username of the user.

func (*FusionAuthClient) RetrieveUserByUsername

func (c *FusionAuthClient) RetrieveUserByUsername(username string) (interface{}, error)

RetrieveUserByUsername Retrieves the user for the given username.

string username The username of the user.

func (*FusionAuthClient) RetrieveUserByVerificationId

func (c *FusionAuthClient) RetrieveUserByVerificationId(verificationId string) (interface{}, error)

RetrieveUserByVerificationId Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user's email or username.

string verificationId The unique verification Id that has been set on the user object.

func (*FusionAuthClient) RetrieveUserComments

func (c *FusionAuthClient) RetrieveUserComments(userId string) (interface{}, error)

RetrieveUserComments Retrieves all of the comments for the user with the given Id.

string userId The Id of the user.

func (*FusionAuthClient) RetrieveUserLoginReport

func (c *FusionAuthClient) RetrieveUserLoginReport(applicationId string, userId string, start interface{}, end interface{}) (interface{}, error)

RetrieveUserLoginReport Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the login counts for that application.

string applicationId (Optional) The application id.
string userId The userId id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveUserLoginReportByLoginId

func (c *FusionAuthClient) RetrieveUserLoginReportByLoginId(applicationId string, loginId string, start interface{}, end interface{}) (interface{}, error)

RetrieveUserLoginReportByLoginId Retrieves the login report between the two instants for a particular user by login Id. If you specify an application id, it will only return the login counts for that application.

string applicationId (Optional) The application id.
string loginId The userId id.
interface{} start The start instant as UTC milliseconds since Epoch.
interface{} end The end instant as UTC milliseconds since Epoch.

func (*FusionAuthClient) RetrieveUserRecentLogins

func (c *FusionAuthClient) RetrieveUserRecentLogins(userId string, offset interface{}, limit int) (interface{}, error)

RetrieveUserRecentLogins Retrieves the last number of login records for a user.

string userId The Id of the user.
interface{} offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
int limit (Optional, defaults to 10) The number of records to retrieve.

func (*FusionAuthClient) RetrieveUserUsingJWT

func (c *FusionAuthClient) RetrieveUserUsingJWT(encodedJWT string) (interface{}, error)

RetrieveUserUsingJWT Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.

string encodedJWT The encoded JWT (access token).

func (*FusionAuthClient) RetrieveWebhook

func (c *FusionAuthClient) RetrieveWebhook(webhookId string) (interface{}, error)

RetrieveWebhook Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.

string webhookId (Optional) The Id of the webhook.

func (*FusionAuthClient) RetrieveWebhooks

func (c *FusionAuthClient) RetrieveWebhooks() (interface{}, error)

RetrieveWebhooks Retrieves all the webhooks.

func (*FusionAuthClient) RevokeRefreshToken

func (c *FusionAuthClient) RevokeRefreshToken(token string, userId string, applicationId string) (interface{}, error)

RevokeRefreshToken Revokes a single refresh token, all tokens for a user or all tokens for an application. If you provide a user id and an application id, this will delete all the refresh tokens for that user for that application.

string token (Optional) The refresh token to delete.
string userId (Optional) The user id whose tokens to delete.
string applicationId (Optional) The application id of the tokens to delete.

func (*FusionAuthClient) SearchAuditLogs

func (c *FusionAuthClient) SearchAuditLogs(request interface{}) (interface{}, error)

SearchAuditLogs Searches the audit logs with the specified criteria and pagination.

interface{} request The search criteria and pagination information.

func (*FusionAuthClient) SearchEventLogs

func (c *FusionAuthClient) SearchEventLogs(request interface{}) (interface{}, error)

SearchEventLogs Searches the event logs with the specified criteria and pagination.

interface{} request The search criteria and pagination information.

func (*FusionAuthClient) SearchUsers

func (c *FusionAuthClient) SearchUsers(ids []string) (interface{}, error)

SearchUsers Retrieves the users for the given ids. If any id is invalid, it is ignored.

[]string ids The user ids to search for.

func (*FusionAuthClient) SearchUsersByQueryString

func (c *FusionAuthClient) SearchUsersByQueryString(request interface{}) (interface{}, error)

SearchUsersByQueryString Retrieves the users for the given search criteria and pagination.

interface{} request The search criteria and pagination constraints. Fields used: queryString, numberOfResults, startRow,
and sort fields.

func (*FusionAuthClient) SendEmail

func (c *FusionAuthClient) SendEmail(emailTemplateId string, request interface{}) (interface{}, error)

SendEmail Send an email using an email template id. You can optionally provide <code>requestData</code> to access key value pairs in the email template.

string emailTemplateId The id for the template.
interface{} request The send email request that contains all of the information used to send the email.

func (*FusionAuthClient) SendPasswordlessCode

func (c *FusionAuthClient) SendPasswordlessCode(request interface{}) (interface{}, error)

SendPasswordlessCode Send a passwordless authentication code in an email to complete login.

interface{} request The passwordless send request that contains all of the information used to send an email containing a code.

func (*FusionAuthClient) SendTwoFactorCode

func (c *FusionAuthClient) SendTwoFactorCode(request interface{}) (interface{}, error)

SendTwoFactorCode Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.

interface{} request The request object that contains all of the information used to send the code.

func (*FusionAuthClient) SendTwoFactorCodeForLogin

func (c *FusionAuthClient) SendTwoFactorCodeForLogin(twoFactorId string) (interface{}, error)

SendTwoFactorCodeForLogin Send a Two Factor authentication code to allow the completion of Two Factor authentication.

string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication.

func (*FusionAuthClient) TwoFactorLogin

func (c *FusionAuthClient) TwoFactorLogin(request interface{}) (interface{}, error)

TwoFactorLogin Complete login using a 2FA challenge

interface{} request The login request that contains the user credentials used to log them in.

func (*FusionAuthClient) UpdateApplication

func (c *FusionAuthClient) UpdateApplication(applicationId string, request interface{}) (interface{}, error)

UpdateApplication Updates the application with the given Id.

string applicationId The Id of the application to update.
interface{} request The request that contains all of the new application information.

func (*FusionAuthClient) UpdateApplicationRole

func (c *FusionAuthClient) UpdateApplicationRole(applicationId string, roleId string, request interface{}) (interface{}, error)

UpdateApplicationRole Updates the application role with the given id for the application.

string applicationId The Id of the application that the role belongs to.
string roleId The Id of the role to update.
interface{} request The request that contains all of the new role information.

func (*FusionAuthClient) UpdateEmailTemplate

func (c *FusionAuthClient) UpdateEmailTemplate(emailTemplateId string, request interface{}) (interface{}, error)

UpdateEmailTemplate Updates the email template with the given Id.

string emailTemplateId The Id of the email template to update.
interface{} request The request that contains all of the new email template information.

func (*FusionAuthClient) UpdateGroup

func (c *FusionAuthClient) UpdateGroup(groupId string, request interface{}) (interface{}, error)

UpdateGroup Updates the group with the given Id.

string groupId The Id of the group to update.
interface{} request The request that contains all of the new group information.

func (*FusionAuthClient) UpdateIdentityProvider

func (c *FusionAuthClient) UpdateIdentityProvider(identityProviderId string, request interface{}) (interface{}, error)

UpdateIdentityProvider Updates the identity provider with the given Id.

string identityProviderId The Id of the identity provider to update.
interface{} request The request object that contains the updated identity provider.

func (*FusionAuthClient) UpdateIntegrations

func (c *FusionAuthClient) UpdateIntegrations(request interface{}) (interface{}, error)

UpdateIntegrations Updates the available integrations.

interface{} request The request that contains all of the new integration information.

func (*FusionAuthClient) UpdateLambda

func (c *FusionAuthClient) UpdateLambda(lambdaId string, request interface{}) (interface{}, error)

UpdateLambda Updates the lambda with the given Id.

string lambdaId The Id of the lambda to update.
interface{} request The request that contains all of the new lambda information.

func (*FusionAuthClient) UpdateRegistration

func (c *FusionAuthClient) UpdateRegistration(userId string, request interface{}) (interface{}, error)

UpdateRegistration Updates the registration for the user with the given id and the application defined in the request.

string userId The Id of the user whose registration is going to be updated.
interface{} request The request that contains all of the new registration information.

func (*FusionAuthClient) UpdateSystemConfiguration

func (c *FusionAuthClient) UpdateSystemConfiguration(request interface{}) (interface{}, error)

UpdateSystemConfiguration Updates the system configuration.

interface{} request The request that contains all of the new system configuration information.

func (*FusionAuthClient) UpdateTenant

func (c *FusionAuthClient) UpdateTenant(tenantId string, request interface{}) (interface{}, error)

UpdateTenant Updates the tenant with the given Id.

string tenantId The Id of the tenant to update.
interface{} request The request that contains all of the new tenant information.

func (*FusionAuthClient) UpdateUser

func (c *FusionAuthClient) UpdateUser(userId string, request interface{}) (interface{}, error)

UpdateUser Updates the user with the given Id.

string userId The Id of the user to update.
interface{} request The request that contains all of the new user information.

func (*FusionAuthClient) UpdateUserAction

func (c *FusionAuthClient) UpdateUserAction(userActionId string, request interface{}) (interface{}, error)

UpdateUserAction Updates the user action with the given Id.

string userActionId The Id of the user action to update.
interface{} request The request that contains all of the new user action information.

func (*FusionAuthClient) UpdateUserActionReason

func (c *FusionAuthClient) UpdateUserActionReason(userActionReasonId string, request interface{}) (interface{}, error)

UpdateUserActionReason Updates the user action reason with the given Id.

string userActionReasonId The Id of the user action reason to update.
interface{} request The request that contains all of the new user action reason information.

func (*FusionAuthClient) UpdateWebhook

func (c *FusionAuthClient) UpdateWebhook(webhookId string, request interface{}) (interface{}, error)

UpdateWebhook Updates the webhook with the given Id.

string webhookId The Id of the webhook to update.
interface{} request The request that contains all of the new webhook information.

func (*FusionAuthClient) ValidateJWT

func (c *FusionAuthClient) ValidateJWT(encodedJWT string) (interface{}, error)

ValidateJWT Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly signed and not expired. <p> This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.

string encodedJWT The encoded JWT (access token).

func (*FusionAuthClient) VerifyEmail

func (c *FusionAuthClient) VerifyEmail(verificationId string) (interface{}, error)

VerifyEmail Confirms a email verification. The Id given is usually from an email sent to the user.

string verificationId The email verification id sent to the user.

func (*FusionAuthClient) VerifyRegistration

func (c *FusionAuthClient) VerifyRegistration(verificationId string) (interface{}, error)

VerifyRegistration Confirms an application registration. The Id given is usually from an email sent to the user.

string verificationId The registration verification Id sent to the user.

type User

type User struct {
	BirthDate              string            `json:"birthDate,omitempty"`
	Data                   map[string]string `json:"data,omitempty"`
	Email                  string            `json:"email,omitempty"`
	EncryptionScheme       string            `json:"encryptionScheme,omitempty"`
	Expiry                 int64             `json:"expiry,omitempty"`
	Factor                 string            `json:"factor,omitempty"`
	FirstName              string            `json:"firstName,omitempty"`
	FullName               string            `json:"fullName,omitempty"`
	ImageURL               string            `json:"imageUrl,omitempty"`
	LastName               string            `json:"lastName,omitempty"`
	MiddleName             string            `json:"middleName,omitempty"`
	MobilePhone            string            `json:"mobilePhone,omitempty"`
	Password               string            `json:"password,omitempty"`
	PasswordChangeRequired bool              `json:"passwordChangeRequired,omitempty"`
	PreferredLanguages     []string          `json:"preferredLanguages,omitempty"`
	Timezone               string            `json:"timezone,omitempty"`
	TwoFactorDelivery      string            `json:"twoFactorDelivery,omitempty"`
	TwoFactorEnabled       bool              `json:"twoFactorEnabled,omitempty"`
	TwoFactorSecret        string            `json:"twoFactorSecret,omitempty"`
	Username               string            `json:"username,omitempty"`
	UsernameStatus         string            `json:"usernameStatus,omitempty"`
}

User describes the parameters relevant to a creating a User

type UserRequest

type UserRequest struct {
	SkipVerification     bool `json:"skipVerification,omitempty"`
	SendSetPasswordEmail bool `json:"sendSetPasswordEmail,omitempty"`
	User                 User `json:"user"`
}

UserRequest describes the actual API request body to create a User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL