> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
