from django.http import HttpRequest

from nkunyim_util.commands.authorize_command import AuthorizeCommand

class OAuth2:
    
    def __init__(self, req: HttpRequest) -> None:
        self.req = req
    
    
    def get_authorization_url(self, id_base_url: str, command: AuthorizeCommand) -> str:
        authorize_url = (f"{id_base_url}/authorize/?response_type={command.response_type}&" 
        + f"client_id={command.client_id}&redirect_uri={command.redirect_uri}&scope={command.client_scope}&"
        + f"state={command.state}&nonce={command.nonce}"
        )
        return authorize_url