openidconnect-rs icon indicating copy to clipboard operation
openidconnect-rs copied to clipboard

Provide AuthorizationRequest::add_scope variant that does not consume scope

Open m-thielen opened this issue 3 years ago • 0 comments

[Disclaimer: I'm pretty new to Rust, I sincerely hope this all makes sense :-)]

I'm using openidconnect-rs in a project where the OpenID Connect scope is configurable; it is read from a config file or the environment as a space separated string. In order to add all scopes to the authorization URL, I have to call add_scope repeatedly and since add_scope consumes the scope, I have to clone it. This seems rather inefficient to me, since this has to be done for each session that is created.

So I think a variant that accepts an Rc<Scope> or Arc<Scope> would be helpful.

m-thielen avatar Jul 12 '22 08:07 m-thielen