```swift

import AWSPluginsCore

class MyOIDCAuthProvider : AmplifyOIDCAuthProvider {
    func getLatestAuthToken() async throws -> String {
        let session = try await Amplify.Auth.fetchAuthSession()
        if let cognitoTokenResult = (session as? AuthCognitoTokensProvider)?.getCognitoTokens() {
            switch cognitoTokenResult {
            case .success(let tokens):
                return tokens.idToken
            case .failure(let error):
                throw error
            }
        }
        
        throw AuthError.unknown("Could not retrieve Cognito token")
    }
}
```