pub struct OAuth2Config {
pub client_id: String,
pub client_secret: String,
pub redirect_uri: String,
pub auth_url: String,
pub token_url: String,
}Expand description
OAuth2 configuration for Spiris Bokföring och Fakturering.
You can obtain OAuth2 credentials by registering your application in the Visma Developer Portal.
Fields§
§client_id: StringClient ID from Visma developer portal.
client_secret: StringClient secret from Visma developer portal.
redirect_uri: StringRedirect URI registered in Visma developer portal. Must exactly match the URI registered in your application settings.
auth_url: StringAuthorization endpoint URL.
token_url: StringToken endpoint URL.
Implementations§
Source§impl OAuth2Config
impl OAuth2Config
Sourcepub fn new(
client_id: String,
client_secret: String,
redirect_uri: String,
) -> Self
pub fn new( client_id: String, client_secret: String, redirect_uri: String, ) -> Self
Create a new OAuth2 configuration.
§Arguments
client_id- OAuth2 client ID from developer portalclient_secret- OAuth2 client secret from developer portalredirect_uri- Callback URI for OAuth2 flow
§Example
use spiris::auth::OAuth2Config;
let config = OAuth2Config::new(
"your_client_id".to_string(),
"your_client_secret".to_string(),
"http://localhost:8080/callback".to_string(),
);Trait Implementations§
Source§impl Clone for OAuth2Config
impl Clone for OAuth2Config
Source§fn clone(&self) -> OAuth2Config
fn clone(&self) -> OAuth2Config
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuth2Config
impl Debug for OAuth2Config
Auto Trait Implementations§
impl Freeze for OAuth2Config
impl RefUnwindSafe for OAuth2Config
impl Send for OAuth2Config
impl Sync for OAuth2Config
impl Unpin for OAuth2Config
impl UnwindSafe for OAuth2Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more