Appeal from a judgment of the Supreme Court (Benza, J.), entered June 15, 2004 in Albany County, which, in a proceeding pursuant to CPLR article 78, granted respondent’s motion to dismiss the petition.
In 1993, petitioner was convicted in Niagara County Court of two counts of rape in the first degree and was sentenced to consecutive prison terms of 8Vs to 25 years. The Fourth Department subsequently upheld the convictions, however, it directed that the sentences run concurrently (People v Reed, 212 AD2d 962 [1995], lv denied 86 NY2d 739 [1995]). In April 2003, during his first parole hearing, petitioner reportedly unsuccessfully challenged the validity of the Niagara County Court judgment *830and sentence. He also apparently brought three CPL article 440 motions raising the same claim, which were also denied.
In June 2004, petitioner commenced this CPLR article 78 proceeding against respondent seeking to have his prison sentence recalculated on the ground that the Niagara County Court judgment and sentence were invalid. Respondent moved to dismiss the petition for failure to name Niagara County Court as a necessary party. In response, petitioner sought to preclude the court’s consideration of that motion on the ground that he was not served in a timely manner. Supreme Court found that service was timely and dismissed the petition, prompting this appeal.
Clearly, the crux of petitioner’s challenge is to the sentence imposed in connection with the judgment of conviction rendered by Niagara County Court. Generally, claims implicating the legality of a sentence are more properly raised on a direct appeal of the judgment of conviction or in a motion pursuant to CPL article 440 (see People ex rel. Pritchard v Harris, 82 AD2d 842, 842 [1981], lv denied 54 NY2d 608 [1981]; see also People ex rel. Sims v Senkowski, 226 AD2d 800 [1996], lv denied 88 NY2d 807 [1996]; People ex rel. De Cicco v Le Fevre, 108 AD2d 995 [1985]). While there are certain circumstances where a CPLR “[a]rticle 78 proceeding in the nature of mandamus is the proper way to seek resentencing” (24A Carmody-Wait 2d § 145:876, at 373 [2000]), it does not appear from the face of the pleadings that the subject matter herein constitutes such a circumstance.
In any event, even if the petition raised issues of arguable merit, the fact remains that the proceeding was correctly dismissed by Supreme Court due to petitioner’s failure to join a necessary party, i.e., Niagara County Court. Clearly, respondent has no authority to grant petitioner his requested relief, namely, vacating the judgment of conviction, invalidating the commitment order and recalculating petitioner’s sentence. Furthermore, to the extent that petitioner’s claim may be construed as a challenge to his time computation, the proper remedy is a proceeding against the appropriate prison authorities (see e.g. Matter of Cruz v New York State Dept. of Correctional Servs., 288 AD2d 572 [2001], appeal dismissed 97 NY2d 725 [2002]; see also People v Leonard, 133 AD2d 938 [1987]). In view of the above, as well as the timely service of respondent’s motion papers, we find that Supreme Court properly dismissed the petition.
Mercure, Carpinello, Lahtinen and Kane, JJ., concur. Ordered that the judgment is affirmed, without costs.