> For the complete documentation index, see [llms.txt](https://docs.perigee.software/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perigee.software/core-modules/credential-management/troubleshooting-credentials.md).

# Troubleshooting Credentials

If you are having issues with the credential store, please verify a couple of things. More than likely, it's one of the following issues:

### Pathing

Verify that you are not setting the <mark style="color:blue;">**`current working directory`**</mark> to something outside of the executable while the Perigee is initializing.&#x20;

A typical load cycle for a Perigee Application looks like this:

```csharp
//Initialize Perigee, and configure credentials
PerigeeApplication.ApplicationNoInit("App", (c) => {

   CredentialStore.RegisterConnectionString("main", "main_test");
   CredentialStore.RegisterRefresh("customCred", (o) => {});
   
});
```

This verifies that the current working directory and pathing is correct. This will load the credential file under `$WorkingDirectory/credentialStore/credentials.[pcb|pce]` depending on the encryption settings.

#### Initialize outside Perigee

See the documentation in [PerigeeApplication](/core-modules/perigeeapplication.md).&#x20;

### Naming the Credential

Unless you've got a VERY specific reason to do so, please don't name the credential. The reason is that you want the **`RefreshName`** to match the **`CredentialName`**.&#x20;

In the below <mark style="color:red;">**BAD**</mark> example, we're naming it <mark style="color:red;">`"DiffName"`</mark>, this will cause the credential to be persisted as this name, not <mark style="color:red;">`"customCred"`</mark>. - the refresh name. If the application was to request a new credential it would forcibly refresh every time as the stored credential name is different.&#x20;

```csharp
// BAD EXAMPLE
CredentialStore.RegisterRefresh("customCred", (o) => {
    return new CredentialStoreItem() { Name = "DiffName", Expiration = DateTimeOffset.UtcNow.AddHours(1) };
});

//Forcibly calls refresh method every time, since the persisted name is different
var c = CredentialStore.GetCredential("customCred");

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.perigee.software/core-modules/credential-management/troubleshooting-credentials.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
