return cli_credentials_get_principal_and_obtained(cred, mem_ctx, &obtained);
}
+/**
+ * @brief Set a new principal to the credential cache.
+ *
+ * @note When setting a new principal, you should make sure to reinit the cache
+ * afterwards!
+ *
+ * @param[in] cred The credentials to set the principal on.
+ *
+ * @param[in] val The principal as a string to set.
+ *
+ * @param[in] obtained The way the principal has specified.
+ *
+ * @return true on success, false otherwise.
+ */
_PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred,
const char *val,
enum credentials_obtained obtained)
}
cred->principal_obtained = obtained;
- cli_credentials_invalidate_ccache(cred, cred->principal_obtained);
return true;
}