Ellicott comments on John 20:23 as follows:

> Whose soever sins ye remit, they are remitted unto them . . .--Comp.
> for the "power of the keys," the Notes on Matthew 16:19; Matthew
> 18:18. Assuming what has there been said, it will be sufficient to add
> that this power is here immediately connected with the representative
> character of the disciples as apostles sent by Christ, as He was
> Himself sent by the Father (John 20:21), and that its validity is
> dependent upon their reception of the Holy Ghost (John 20:22), by whom
> Christ Himself is present in them (John 14:18; John 16:7-11).

Let us take a closer look at both Matt 16:16-19 and John 20:23.

Matt 16:16-19, “Simon Peter answered, ‘You are the Messiah, the Son of the living God.’  And Jesus said to him, ‘Blessed are you, Simon bar Jona, because flesh and blood did not reveal this to you, but My Father who is in heaven.   I also say to you that you are Peter [Petros (masc), a stone], and upon this rock [Petra (fem), large rock, bed-rock] I will build My congregation; and the gates of Hades will not overcome it.  I will give you the keys of the kingdom of heaven; and whatever you bind on earth will have been bound [simple future + perfect participle passive] in heaven, and whatever you loose on earth will have been loosed [simple future + perfect participle passive] in heaven.’” (McG)  We observe several things about this passage.

 - The community/congregation of believers is to be based either on Christ as the Rock, or, the truth that Jesus is “the Messiah, the Son of the living God”.  It is obvious that both are intended.
 - The authority delegated in this passage is such that the disciples could only decide what was consonant with heaven, because they decided (bound and loosed) that which heaven had already bound and loosed.  Conversely, decisions not in accord with heavenly decisions have no authority.
 - Note these comments (in an appendix) of J B Phillips in his translation of the New Testament in Modern English:  Matthew 16:19 and 18:18, "forbidding" and "permitting".  There is a very curious Greek construction here, viz, a simple future followed by the perfect participle passive.  If Jesus had meant to say quite simply, Whatever you forbid on earth will be forbidden in Heaven", can anyone explain why the simple future passive is not used?  It seems to me that if the words of Jesus are accurately reported here, and I have no reason to doubt it, then the force of these sayings is that Jesus’ true disciples will be so led by the Spirit that they will be following the heavenly pattern.  In other words what they “forbid” or “permit” on earth will be consonant with the Divine rules.
Thus, we conclude that the “keys of the kingdom” is the enlightenment of the Holy Spirit revealing the will of heaven, consistent with the teachings of Scripture.  This is confirmed by Luke 11:52.
 - Matt 18:18, “Truly I say to you, whatever you bind on earth will have been bound [simple future + perfect participle passive] in heaven; and whatever you loose on earth will have been loosed [simple future + perfect participle passive] in heaven.” (McG)  This provides the same message as contained above.  The authority delegated here extends only as far as it accords with the will of heaven.  Further, in this passage, authority is given to resolve disputes and “wrongs” between members of the Christian community. (v15-17)  Again, this can only be done using the principles of Scripture under the enlightenment of the Holy Spirit.

Now let us examine the passage in John 20:23.  Again, it cannot be separated from the previous verse where Jesus bequeathed the gift of the Holy Spirit, thus imparting the source of divine wisdom to the disciples.

Note especially the tense of the verbs used in John 20:23:

 - if you forgive: ἀφῆτε (aphēte) Aorist Subjunctive Active
 - they are forgiven: ἀφέωνται (apheōntai) Perfect Indicative Middle or Passive
 - if you withhold: κρατῆτε (kratēte) Present Subjunctive Active
 - it is withheld: κεκράτηνται (kekratēntai)  Perfect Indicative Middle/Passive

Note that the verbs depicting the disciple's actions are active and aorist while the effect on the sins is perfect, ie, already completed.

Thus, what the disciples would be doing is making comments and pronouncements, via the enlightenment of the Holy Spirit that is consonant with the decisions that had already be taken in heaven.  This is consistent with Jesus' earlier statements in Matthew.

Only God can forgive sins (Mark 2:7, Luke 5:21, 1 John 1:9, etc) but the disciples would be the conduit via which the enlightenment and encouragement to seek forgiveness would come.