func (c *forgerockClient) Identity() (*identity.Identity, error) {
	return c.identity(forgerockIdentityProvider), nil
}
Identity returns the identity information for the user.
package external
import (
	"bytes"
	"context"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/mmmorris1975/aws-runas/credentials"
	"github.com/mmmorris1975/aws-runas/identity"
	"io"
	"net/http"
	"net/url"
	"strings"
	"time"
)
const (
	frOathSvcName = "mfa_oath_authentication"
	frPushSvcName = "mfa_push_authentication"
	forgerockIdentityProvider = "ForgerockIdentityProvider"
)
type forgerockClient struct {
	*baseClient
	baseUrl *url.URL
	realm   string
}
func NewForgerockClient(url string) (*forgerockClient, error) {
	bc, err := newBaseClient(url)
	if err != nil {
		return nil, err
	}
	c := &forgerockClient{baseClient: bc}
	if err = c.parseRealm(); err != nil {
		return nil, err
	}
	if err = c.parseBaseUrl(); err != nil {
		return nil, err
	}
	return c, nil
}
func (c *forgerockClient) Authenticate() error {
	return c.AuthenticateWithContext(context.Background())
}
func (c *forgerockClient) AuthenticateWithContext(ctx context.Context) error {
	if err := c.gatherCredentials(); err != nil {
		return err
	}
	return c.auth(ctx)
}